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
- DO C AND D Topics covered: Sorting Algorithms Consider the following series of random numbers: 80 35 50 18 36 29 25 17 67 23 12 19 5 3 2 Use bubble sort algorithm to draw the sorting passes Use merge sort algorithm to draw the sorting process Can you compare the performance of performed steps in a) and b) Which algorithm has performed better, justify.arrow_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
- Main application of the trees include: (select 6 correct answers) * Make a database that collect and organize input data Make information easy to search Manipulate sorted lists of data Provides the right way to organize information A workflow for compositing digital images for visual effects Router algorithms Manage large amounts of data efficiently Form of a multi-stage decision-making Manipulate hierarchical dataarrow_forwardURGENT!!!arrow_forwardDesign 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_forward
- 1. 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_forwardWhen should a sequential search algorithm be used and when should a binary search algorithm be utilised?arrow_forwardComputer Science 1)What are the steps in the selection sort algorithm? Group of answer choices Split the array into two subarrays, sort each subarray, and append the two arrays together. Starting at index 0, search the entire array to find the smallest value and swap the smallest value with the value at index 0. 2)Suppose there an integer threshold such that the expression n2 is equal to the expression 9n-8 at that threshold, and is larger for all integers values larger than the threshold. What does this mean?arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios