Question: P . Initialize ( ) initializes the data structures. P . Insert ( ) inserts elements x in P . P . ExtractMax ( )
PInitialize initializes the data structures.
PInsert inserts elements in
PExtractMax returns the maximum element of and deletes it from
PSize returns the number of elements in
a Analyze the running time of Program assuming that is implemented by some data
structure which takes time for Insert where is the number of elements in
and time for ExtractMax Analyze the total number of time for both Insert
and PExtractMax operations. Note that the time for PInsert and PExtractMax
is depended on the number of elements in 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 is implemented by some data
structure which takes time for PInsert and time for PExtractMax where
is the number of elements in Analyze the total number of time for both Insert
and PExtractMax operations. Note that the time for PInsert and PExtractMax
is depended on the number of elements in 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
