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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:40
Hello my name is mihai and i need your : )i have to do a python project in computer science and i’m really busy with my mocks this period of time besides this i’m not good at coding so could someone pls pls pls sort me out ? i actually beg ; ))
Answers: 1
question
Computers and Technology, 23.06.2019 02:00
Which of the following is not a source of sustainable raw materials? a) coal mine b) flick of sheep c) cotton plantation d) line forest.
Answers: 2
question
Computers and Technology, 23.06.2019 10:30
Would a ps4 wired controller work on an xbox one
Answers: 1
question
Computers and Technology, 23.06.2019 16:30
You have read about the beginnings of the internet and how it was created. what was the internet originally created to do? (select all that apply) share research. play games. communicate. share documents. sell toys
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
question
Geography, 04.12.2019 02:31
Questions on the website: 13722363