subject

A min-heap is useful when we are interested in the minimum value of set of numbers. Now, instead of the min, we are interesting in the K-th smallest value. a. Please design a data structure to allow the following two operations: push (insert a new number) and find_Kmin (return the value of the K-th smallest number without removing it). Both operations should be done in O(log K) time.
b. In addition to push and find_Kmin, now we also want to support the pop operation to return and remove the K-th smallest element. Please design a data structure to support these three operations, and each operation should take O(log n) time with n being the size of the current set.

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 01:30, edgytaehyung
Someone wishes to run the software on another computer system that runs an operating system that does not support the software what can he do
Answers: 3
image
Computers and Technology, 22.06.2019 20:00, ayoismeisalex
When you mouse over and click to add a search term this(these) boolean operator(s) is(are) not implied. (select all that apply)?
Answers: 1
image
Computers and Technology, 23.06.2019 07:30, Braxtonw875
What part of the interface displays the external references contained in a selected cell? the status bar the review tab the scroll bar the formula bar
Answers: 1
image
Computers and Technology, 24.06.2019 03:00, 2020IRodriguez385
With editing, word automatically displays a paste options button near the pasted or moved text. a. cut-and-paste b. drag-and-drop c. inline d. copy-and-carry
Answers: 1
You know the right answer?
A min-heap is useful when we are interested in the minimum value of set of numbers. Now, instead of...

Questions in other subjects:

Konu
Physics, 21.07.2019 23:20