Talk:TADM2E 3.11

From Algorithm Wiki
Revision as of 00:01, 6 April 2015 by SriPrasanna (talk | contribs)
Jump to: navigation, search

For the answer given in part 2, the space required seems to be the sum from 1 to n of n which is n(n+1)/2. This gives O(n**2) for space requirements. Doesn't it?


Why cant we just sort the input (array)? Will this not mean the smallest number between x and y is always x?