@Kamakshii: If you are willing to use O(n) extra space, you can use a
hash table. But with constant space, all the methods I can think of
are equivalent to sorting. Perhaps others can join in with constant-
space methods that don't involve sorting.

Dave

On Aug 30, 1:53 pm, Kamakshii Aggarwal <kamakshi...@gmail.com> wrote:
> @dave:is there any other method than sorting?
>
>
>
>
>
> On Wed, Aug 31, 2011 at 12:19 AM, Dave <dave_and_da...@juno.com> wrote:
> > @Kamakshii: With O(1) extra space, it can be done with O(n)
> > comparisons. Do a radix sort on the input (no comparisons), and then
> > check adjacent numbers for equality.
>
> > Dave
>
> > On Aug 30, 1:34 pm, Kamakshii Aggarwal <kamakshi...@gmail.com> wrote:
> > > develop an algorithm to find duplicates in a list of numbers without
> > using a
> > > binary tree..if there are n distinct numbers in the list ,how many times
> > > must two numbers be compared for equality in your algorithm?what if all
> > > numbers are equal?
>
> > > --
> > > Regards,
> > > Kamakshi
> > > kamakshi...@gmail.com
>
> > --
> > 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?hl=en.
>
> --
> Regards,
> Kamakshi
> kamakshi...@gmail.com- Hide quoted text -
>
> - Show quoted text -

-- 
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?hl=en.

Reply via email to