Question: Q 1 [ 1 5 pts . ] : Given the following key sequence ( 5 , 2 3 , 8 , 1 4 ,

Q1[15 pts.]: Given the following key sequence (5,23,8,14,13,2,7) build the dynamic binary
search tree WITHOUT BALANCING IT. How many probes (i.e., comparisons) does it
take to determine that key 100 is not in the tree? (In this study case, the root is 5; the next
element 23>5, so it goes to the right, etc).
Q2[5 pts.]: How many leaves does a 3-ary tree have if its depth is 7?(HINT: see the pattern for
a full binary tree of depth n and modify it).
Q3[10 pts.]: How many total nodes does a 5-ary tree have if its depth is 6?
Q4[10 pts.]: Given the preorder traversal of a tree is: a,b,c,d,e and the inoder traversal of the tree
is: b,a,e,d,c. What is the POSTORDER traversal of that tree?
Q5[15 pts.]: Consider a binary tree containing n nodes.
(a) What is the theta value for the preorder traversal of this tree?
(b) What is the theta value for the inorder traversal of this tree?
(c) What is the theta value for the postorder traversal of this tree?
Q6[15 pts.]: Hash the given file (5,23,8,14,13,2,7) and use linear probing and the table size of
11. How many total collisions occurred? What is the loading density of the table?
Q7[15 pts.]: Hash the given file (5,23,8,14,13,2,7) and use overflow chaining. How many
comparisons are needed to determine whether key value 12 is in the table?
Q8[15 pts.]: What should the loading factor be (on ANY HASH TABLE) if you want to have an
average of 1.3 comparisons per search if LINEAR PROBING?
I need proper answers for all the questions but not AI generated. Also should be handwritten if necessary.
Thanks.

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!