Question: Question about Data Structure Implement & Analysis (C++) Only Descriptions and Explanations are fine. Do not need codes. 1. Suppose we want to implement a
Question about Data Structure Implement & Analysis (C++)
Only Descriptions and Explanations are fine. Do not need codes.

1. Suppose we want to implement a Priority Queue. In lecture, we explored using a std::vector in a few ways: unsorted, sorted, and as a heap. Suppose I wish to store the underlying data as an AVL Tree. (a) For each of the fundamental operations of a PriorityQueue, explain briefly how you would implement it with an AVL Tree. Each should take you 1-2 sentences at most; you do not need to write full code. If something is a standard AVL tree operation, such as a re-balance, you need only refer to it. You do not need to re-write the description. Then, state how long these will take to run. The last one is done for you as an example (only because last instead of first will fit better into a Gradescope outline). i. extractMino: ii. insert ii. min() : We could follow left pointers from the root until a node does not have a left pointer. That is the min. This takes O(log n) time because the AVL Tree has (log n) depth. (b) Is this better or worse than a heap, as shown in lecture? Why or why not? You need only a brief explanation for why you said yes or no
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
