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 02:00
Aletter or menu command that starts an action when the user presses the designated letter and the alt key together is called what?
Answers: 1
question
Computers and Technology, 23.06.2019 21:20
For positive constants a and b, the force between two atoms in a molecule is given f(r) = −a r2 + b r3 , where r > 0 is the distance between the atoms. note: a and b are upper case letters. (a) find f '(r) = (b) find the critical point for f(r). r = (c) find f ''(r) = (d) find the value of r so that f ''(r) = 0.
Answers: 1
question
Computers and Technology, 24.06.2019 16:50
Develop the program incrementally: a) start by reading and displaying each line of the input file to make sure you are reading the data set correctly. b) use the split string method to extract information from each line into a list. print the list to prove that this step is working correctly. d) convert the exam scores to type int and calculate the student’s average. display those items to prove this step is working correctly. e) create a tuple containing the six items for each student (name, exam scores, exam mean). display the tuples to prove this step is working correctly. (optionally, you may want to have the exam scores in a list so your tuple is (name, scores_list, f) append each tuple to a list. display the list to prove this step is working correctly. g) use the sort list method to re-order the tuples in the list. display the list to prove this step is working correctly. h) use a for statement to display the contents of the list as a table (with appropriate formatting). i) use a for statement to calculate the average of all scores on exam #1, then display the results. note that you could have calculated this average within the first loop, but we are explicitly requiring you to do this calculation by looping though your list of tuples. j) add the logic to calculate the average of all scores on exam #2, then display the results.
Answers: 2
question
Computers and Technology, 24.06.2019 18:30
In what way is your social media footprint related to your digital id
Answers: 1
You know the right answer?
Problem 2: heaps.

min-heap: construct a min_heap from the following set of integers. r...
Questions
question
Mathematics, 18.02.2021 01:30
question
History, 18.02.2021 01:30
question
Spanish, 18.02.2021 01:30
question
Mathematics, 18.02.2021 01:30
question
Mathematics, 18.02.2021 01:30
question
Mathematics, 18.02.2021 01:30
question
Biology, 18.02.2021 01:30
Questions on the website: 13722361