Since we know the range of numbers in an array. Counting sort is a trivial solution for it
On Tue, Jul 6, 2010 at 9:48 PM, Anil C R <cr.a...@gmail.com> wrote: > do you need an algorithm which is O(1) in space? if not it's trivial. > Anil > > > > On Tue, Jul 6, 2010 at 7:29 PM, sharad kumar <sharad20073...@gmail.com>wrote: > >> Given an array of n numbers in which all the members are less than or >> equal to k (k<n). device an algorithm of order O(k) to find the first >> repeating element >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algoge...@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> >> . >> 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 algoge...@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> > . > 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 algoge...@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?hl=en.