Difference between revisions of "Talk:TADM2E 4.2"

From Algorithm Wiki
Jump to: navigation, search
(Created page with "a) Couldn't we just keep track of minimum and maximum value encountered while iterating through array? c) Wouldn't sorting with n log n, then scanning through the array for th...")
 
Line 1: Line 1:
a) Couldn't we just keep track of minimum and maximum value encountered while iterating through array?
+
a) Couldn't we just keep track of minimum and maximum value encountered while iterating through array?  
 +
 
 
c) Wouldn't sorting with n log n, then scanning through the array for the pair in question actually be O(n^2) complexity?
 
c) Wouldn't sorting with n log n, then scanning through the array for the pair in question actually be O(n^2) complexity?

Revision as of 16:32, 8 November 2014

a) Couldn't we just keep track of minimum and maximum value encountered while iterating through array?

c) Wouldn't sorting with n log n, then scanning through the array for the pair in question actually be O(n^2) complexity?