ctci icon indicating copy to clipboard operation
ctci copied to clipboard

Rework example 7 and provide an alternative way of solving the problem.

Open vosst opened this issue 10 years ago • 0 comments
trafficstars

While browsing through the example questions, I kind of got stuck at 11.7 and its proposed solution. After a bit of research, I came up with an alternative way of solving the problem using a heap (T: O(n log(n)), S: O(1)), leaving the original approach relying on a sorted collection in place.

vosst avatar Jul 07 '15 09:07 vosst