subject

Problem 2: heaps.

min-heap: construct a min_heap from the following set of integers. remember to use successive adds to arrive at your final heap. (you do not need to show all the intermediate steps, however, showing those can in case you make an error somewhere down the line.)

1, 19, 7, 5, 6, 42, 21, 13, 56, 78, 29, 3, 14

remove_min: show the result of two successive remove_min operations on the heap formed in part a.
perform the following operations on the min_heap: add(45)

as you must have noticed the set of integers provided to both the bst and heap problems were the same. however, the structures formed are vastly different. what can you say about the relative heights (and therefore the worst-case cost of operations) of the bst as compared to the heap? what conclusions are you able to draw regarding the relative efficiency of the 2 data structures? (remember that log213 = 3.7)

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:30
Under which key category do the page up and page down keys fall? page up and page down keys fall under the keys category.
Answers: 1
question
Computers and Technology, 23.06.2019 03:10
Acomputer has a two-level cache. suppose that 60% of the memory references hit on the first level cache, 35% hit on the second level, and 5% miss. the access times are 5 nsec, 15 nsec, and 60 nsec, respectively, where the times for the level 2 cache and memory start counting at the moment it is known that they are needed (e.g., a level 2 cache access does not even start until the level 1 cache miss occurs). what is the average access time?
Answers: 1
question
Computers and Technology, 23.06.2019 21:20
In microsoft word, when you highlight existing text you want to replace, you're in              a.  advanced mode.    b.  automatic mode.    c.  basic mode.    d.  typeover mode
Answers: 1
question
Computers and Technology, 24.06.2019 11:20
Print "censored" if userinput contains the word "darn", else print userinput. end with newline. ex: if userinput is "that darn cat.", then output is: censoredex: if userinput is "dang, that was scary! ", then output is: dang, that was scary! note: if the submitted code has an out-of-range access, the system will stop running the code after a few seconds, and report "program end never reached." the system doesn't print the test case that caused the reported message.#include #include using namespace std; int main() {string userinput; getline(cin, userinput); int ispresent = userinput.find("darn"); if (ispresent > 0){cout < < "censored" < < endl; /* your solution goes here */return 0; }
Answers: 3
You know the right answer?
Problem 2: heaps.

min-heap: construct a min_heap from the following set of integers. r...
Questions
question
English, 24.03.2020 18:01
Questions on the website: 13722361