i think you need to define whether the array is in a sorted order or not. some solutions work on both, but if you want the optimized solution, more information is needed
On Oct 11, 2:59 pm, Asquare <[email protected]> wrote: > Given an array of size n. It contains numbers in the range 1 to n. > Each number is present at least once except for 2 numbers. > Find the missing numbers. > > I know of a solution using another array to store frequency of each > number.. > But this holds for than 2 nums also.. > So Is there any other solution apart from this specific for 2 nums and > of lesser complexity..?? -- 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.
