+1 (218) 451-4151
glass
pen
clip
papers
heaphones

Use the approach of either Exercise C-9.39 or C-9.40 to reimplement the method getFavorites of…

Use the approach of either Exercise C-9.39 or C-9.40 to reimplement the method getFavorites of…

Use the approach of either Exercise C-9.39 or C-9.40 to reimplement the method getFavorites of the FavoritesListMTF class from Section 7.7.2. Make sure that results are generated from largest to smallest.Exercise C-9.39Explain how the k largest elements from an unordered collection of size n can be found in time O(n+k logn) using a maximum-oriented heap.Exercise C-9.40Explain how the k largest elements from an unordered collection of size n can be found in time O(nlogk) using O(k) auxiliary space.