Question: will give thumbs up, thanks! Data Structure Design 10. For some positive integer k, design a data structure that supports the following two operations: Insert(x),

will give thumbs up, thanks!
Data Structure Design 10. For some positive integer k, design a data structure that supports the following two operations: Insert(x), which inserts a new item x into the data structure, and extractkthSmallest(), which removes and returns the kth smallest item currently in the data structure. You may assume extract is never called if the number of items n is less than k. Insert must run in O(log n) time and extractkthSmallest must run in O(log n) time (note that O(k log n) is easy to achieve but this is not fastest enough for the extract routine) Algorithm Design 11. K-way merge: Suppose you are given k sorted arrays of comparable items. Suppose that the total number of items from all the lists is n. Design an order O(n log k) time algorithm to merge the k lists into 1 single length n list in sorted order. 12. Product Problem: Suppose you are given a size n array A of numbers. Design an algorithm to compute the size n array B defined such that B[i] = A[OPA[1].AF-1)"A[i+1]* *A[n-1]. That is, Bli] is the product of all elements of A except for element Ali]. Further, you must compute B without using division, and your algorithm must run in O(n) time
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
