On 8/4/06, kumar <[EMAIL PROTECTED]> wrote: > > Let A is an array of positive or negative > integers of size n, where A[1] < A[2] < A[3] < ... < A[n]. Write an > algorithm to find an i such that A[i] = i provided such i exists. What > is the order of execution time of algorithm. Prove that O ( log n ) is > the best possible.. >
You can solve this problem with famous binary search algorithm. http://en.wikipedia.org/wiki/Binary_search > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---
