Question: Heaps a ) Using a Heap data structure, and the Push and Pop operations on the heap, tell me in words, how would you sort
Heaps
a Using a Heap data structure, and the Push and Pop operations on the heap, tell me in words, how
would you sort a list of integers? pts
Using the figure below
a List the steps the Dijkstra Algorithm will take to find the distance from A to E pts
b What is the distance from A to E according to the Dijkstra Algorithm? pts
For the sequence pt Note: you dont have to sort this data to get the answers
An inversion is any pair that is in the wrong order. They dont have to be next to each other.
a How many inversions are there in the above sequence? List them
b How many inversions are there if you exchange the and the in the sequence?
This is the new sequence
c What is the maximum number of inversions in a reverse sorted worst case sequence of N numbers? This
question is not related to parts a and b N is a variable and can have any positive value so give me the
answer in terms of NSuggestion: Try a few sequences to see if your answer makes sense
A simplified BTree like we studied in this class has keys at the top level m This tree has no root:
the top level is level and it has keys The Btree has million leaves at the bottom level. Each key has
child keys at the next level and each of those has child keys at the next level and so on How many levels
are in the tree? Hint: Remember leaves are only at the bottom level of the tree, and the # of leaves # of keys
at the bottom level. Suggestion: Check your answer to see if it makes sense. pts
Given the recurrence relationship: T and TNTN N
a Show that TNTNN pts use the method on bottom half of page the rth edition text,
or page in rd edition
b Show TNTNN pts
c Let N let k logN; what does T equal? Hint Plug the numbers in to the formula and compute
pts
Find the Median of Three aka M of this sequence pts
Remember, the M has to be one of the data points. 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
