Question: Think about perfect ( completely full ) M - ary trees. Assume each leaf node is full as well. 2 3 . What is the

Think about perfect (completely full) M-ary trees. Assume each leaf node is full as well.
23. What is the total number of keys in the tree when the total number of levels is 5?
a)M=2
b)M=10
24. In order to look for a particular key in a perfect M-ary tree having N elements(keys), which makes it faster? Having a smaller M, or larger M? Why?
25. Think about the worst case scenario where your key is found at the bottom of the tree. Calculate the total number of comparisons in a perfect tri-ary tree (Each leaf node is full as well) using your own algorithm given in #22 above. Express your answer as T(K)=??? where K is the total number of keys.
26. What is the worst-case big-O for searching in a perfect tri-ary tree? Explain.
27. What is the best case big-O for searching in a perfect tri-ary tree? Explain.
28. What is the average big-O for searching in a perfect tri-ary tree? Explain.
Think about perfect ( completely full ) M - ary

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 Programming Questions!