Sorting

Can anyone suggest me how to check whether a given linked list is nearly sorted or totally random???



right now what i am doing is checking half the list and comparing adjacent elements to find out if list is random or nearly sorted using flag statement.. but its not very full-proof and i need a more concrete logic. Can anyone please suggest something??
Topic archived. No new replies allowed.