probably the only entirey different approach ( except small variations in Bsearch ) is use of Hashing ( or for that matter , HashMaps )
On Sun, Oct 25, 2009 at 1:36 PM, harit agarwal <agarwalha...@gmail.com>wrote: > the only other way can be the jump exponentially during search as in binary > search a[mid] is checked so if a[mid]!=x then make low=highest index of > a[mid]!=x this will reduce the comparisions....in binary search > ex-1,1,1,2,2,2,3,3,3,4,4,5,5(13 elements) > let's search for 4 > modify binary search > a[mid]=3 // !=4 > such that mid=highest index of 3 in array and make low=mid+1 > this way it can be done....just modify binary search. > > > > -- nikhil- --~--~---------~--~----~------------~-------~--~----~ 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 algogeeks+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---