subject

This problem is about the array-based binary heap implementation of a priority queue. let h denote the backing array, i. e h is a binary min-heap array. you should assume that the universe of possible keys is extremely large relative to the size of the heap (i. e., it is not practical to use a position array as described on p. 65 of the ) give an algorithm for a new operation decreasekey(index, delta) that subtracts delta from the key located at the given index in h, and restores the heap ordering. report the time taken by the algorithm.(b) suppose we also want an operation findkey(v) that returns the index of a key k in h (if k appears more than once, then it does not matter which index is returned). describe a modified implementation of the heap in which your findkey(v) operation is o(1), finding the minimum is still o(1), and the operations to insert a key or remove the minimum are still o(log n).

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 08:30, marialuizavalen
Today is the anniversary of me being on yet, i don't need it anymore! here's a picture of my dog wearing a bowtie! my question is, how do i delete my account?
Answers: 1
image
Computers and Technology, 22.06.2019 20:00, Jana1517
What is the worst-case complexity of the maxrepeats function? assume that the longest string in the names array is at most 25 characters wide (i. e., string comparison can be treated as o( class namecounter { private: int* counts; int nc; string* names; int nn; public: namecounter (int ncounts, int nnames); int maxrepeats() const; }; int namecounter: : maxrepeats () { int maxcount = 0; for (int i = 0; i < nc; ++i) { int count = 1; for (int j = i+1; j < nc; ++j) { if (names[i] == names[j]) ++count; } maxcount = max(count, maxcount); } return maxcount; }
Answers: 3
image
Computers and Technology, 23.06.2019 04:00, terrell31
Write a method that takes in an array of point2d objects, and then analyzes the dataset to find points that are close together. be sure to review the point2d api. in your method, if the distance between any pair of points is less than 10, display the distance and the (x, y)s of each point. for example, "the distance between (3,5) and (8,9) is 6.40312." the complete api for the point2d adt may be viewed at ~pf/sedgewick-wayne/algs4/documenta tion/point2d. html (links to an external site.)links to an external site.. try to write your program directly from the api - do not review the adt's source code.
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
You know the right answer?
This problem is about the array-based binary heap implementation of a priority queue. let h denote t...

Questions in other subjects:

Konu
Mathematics, 26.10.2020 19:40
Konu
Mathematics, 26.10.2020 19:40
Konu
Mathematics, 26.10.2020 19:40
Konu
Health, 26.10.2020 19:40