Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(e) (5 points) How is a heap different from a binary search tree and a 2-3 tree? When would you use a heap over a
(e) (5 points) How is a heap different from a binary search tree and a 2-3 tree? When would you use a heap over a binary search tree or a 2-3 tree?
A 2-3 tree is self-balancing, meaning that as we insert, it will automatically balance its height, preventing itself from growing too tall. Binary search trees are not self-balancing. Depending on the order in which we insert items, it's possible to have a very tall tree. (a) (10 points) Consider the values 1, 4, 2, 6, 5, 3. Give an insertion order of these values that would result in a binary search tree with maximum height. Draw the resulting binary search tree. (b) (10 points) Create a 2-3 tree by inserting values in the same order you gave in the previous question. (C) (5 points) Give a tight upper bound on the find operation of a binary search tree. (d) (5 points) Give a tight upper bound on the find operation of a 2-3 treeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started