Question
Data Structure and advance programming:
Assuming we have the following array of keys, arrived from left to right
30 45 57 69 89 102 107
a) Draw the BST (binary search tree)
b) how many searches does it take to locate 107 when we use
1) Sequential search.
2) Binary search
3) BST
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 1 steps with 3 images

Knowledge Booster
Similar questions
- I need both subpartsarrow_forward3. What is the best sorting algorithm can be combined with the following and explain the reason briefly: (a) Radix Sort (b) Bucket Sortarrow_forwardnum Ex 6) This exercise uses sub-algorithms. Trace it for when input value is 6 and complete the trace tables. Also note that there are two variables name num, one in the main algorithm and another in the sub-algorithm. They are not related. Assume input is a positive integer. Write pre- post-conditions for each of these algorithms (the main one and the sub-algorithm). Note that the prime sub-algorithm is similar to the algorithm in Ex 1) but instead of reading input and producing outputs, it has a parameter num, and it returns the result. Also note that the =true is in gray color, which means it can be ignored. Note that since the sub-program is called several times, it's better that you use separate trace tables, one for each call, as shown below. output start num 142 i<(i+1 is num end T prime()=true F prime(num) start flag-true d-2 flag = true and ds num/2 num mod d = 0 flag-false ded+1 ret flag 3 returned value flag Mag # # returned valuearrow_forward
- Design data structures: present five data structures including B-tree for big data (you find data), for sorting algorithms. In this project, you will implement and analyze the following. Median finding, Order Statistics, and Quick Sort: In this project, you will implement the median-finding algorithms. The user should be able to select the "k”, i.e., the rank of the number desired as output (k = n/2 is the median). You should also be able to select groups of 3, 5, 7, etc. in the linear-time median finding algorithm and be able to compare the performance of each. Also, implement the randomized median finding algorithm and compare it against the linear-time one. Implement quick sorting using both algorithms and compare the performances of these different versions.arrow_forward1. The sequential search algorithm will always find the first occurrence ofan item in a data set. Create a new sequential search method that takes asecond integer argument indicating which occurrence of an item you wantto search for.arrow_forward332 File structures and databaseSuppose you have these inputs: M, I, T, Q, L, H, R, E, K, P, C, A.a. Show the binary search tree for these inputs.b. Show how to store the binary search tree in an array with the nodestructure (key, left, right).arrow_forward
- Assessments of algorithmsTime-based calculation of the algorithmic complexity of binary search. Please provide specific instructions.arrow_forward5arrow_forwardProblem 2-Python We have a dictionary where the keys are the names of all your relatives and the values are their ages. Write a Python program to iterate/loop over the dictionary and find the oldest member of your family. Sample output: The oldest relative is Helko. Recall: Iterating over a dictionary iterates over its KEYS. HINT: First we initialize maximum_age to 0 and maximum_age_relative to and empty string. These variables will be updated during the loop. Then we need to iterate over the keys of the dictionary my_family to find the member and their age.If the age is greater than the current maximum_age, we update maximum_age with this new maximum age. Then we update the maximum_age_relative with the new member. Given Code: my_family = {'Bob':72, 'Susan':39, 'Helko':81, 'Gertrude':4} maximum_age = 0 maximum_age_relative = ""arrow_forward
arrow_back_ios
arrow_forward_ios