yaar I can use simple O(n) sweep to find out who all are equal, I think it can't be less than this
On Sat, Dec 4, 2010 at 8:05 PM, Abioy Sun <[email protected]> wrote: > 2010/12/4 ankit sablok <[email protected]>: > > as all the elements are sorted in the array make a min heap of the > > array elements and as min heap is a tree of keys querying a min heap > > or a binary search tree requires operations with time equal to the > > height of the tree which is log(n) hence time for querying a min heap > I think you might be use a log(n) time to find out a element whose > value is equal to some certain index, so the complexity could be > n*log(n)? > > -- > 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]<algogeeks%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- 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?hl=en.
