Question: Match the algorithms on the left with their correct time complexity from the right. Note that you dont have to use all of the time

Match the algorithms on the left with their correct time complexity from the right. Note that you dont have to use all of the time complexities on the right.

1. Inserting one element in a Heap of size n

a) (1)

2. Heapsort for n elements

b) (logn)

3. Heapify an array of size n

c) (n)

4. Preorder Traversal of a balanced tree with n nodes

d) (n logn)

5. Delete the smallest element from a BST with n elements worst case

e) (n2)

6. Finding the value of the largest element in a MaxHeap of size n

f) (n3)

7. Finding the value of the smallest element in a MaxHeap of size n

g) (2n)

8. Depth First Search, assuming a complete Graph with n vertices

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!