hi, this is regarding a problem from programming pearls by jon bentley column 5. I have few questions , 1) how to check if an array is sorted or not. Can it be done it sub - linear time
2) In section 5.8 problem 5, he describes saying that checking a array is sorted or not takes n-1 operations. How can you add partial checking to the function at significantly less cost. I understand the n-1 part doing a for(i=0;i<n-1;i++) if(arr[i] > arr[i+1] return 0; but i don't get the partial checking part. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---