Question: Question 4 . Consider the following program:P . Initialize ( ) initializes the data structures.P . Insert ( ) inserts elements x in P .
Question Consider the following program:PInitialize initializes the data structures.PInsert inserts elements x in PPExtractMax returns the maximum element of P and deletes it from PPSize returns the number of elements in Pa Analyze the running time of Program assuming that P is implemented by some data structure which takes Thetas time for PInsert where s is the number of elements in P and Theta time for PExtractMax Analyze the total number of time for both PInsert and PExtractMax operations. Note that the time for PInsert and PExtractMax is depended on the number of elements in P which changes over the running time of the algorithm. Operations PInitialize and PSize take constant time. Show your work.b Analyze the running time of Program assuming that P is implemented by some data structure which takes Theta time for PInsert and Thetas time for PExtractMax where s is the number of elements in P Analyze the total number of time for both PInsert and PExtractMax operations. Note that the time for PInsert and PExtractMax is depended on the number of elements in P which changes over the running time of the algorithm. Operations PInitialize and PSize take constant time. Show your work.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
