(a)
The sequence of steps in a binary search to x = 2 in the list 1, 2, 3,4,5,6,7,8,9. How many times is x compared with an element in the list. How many times would it be compared with an element in the list if we employed a linear search a ternary, rather than a binary search.
(b)
The sequence of steps in a binary search to x = 2 in the list 1, 2, 3,4,5,6,7,8,9. How many times is x compared with an element in the list. How many times would it be compared with an element in the list if we employed a linear search a ternary, rather than a binary search.
(c)
The sequence of steps in a binary search to x = 2 in the list 1, 2, 3,4,5,6,7,8,9. How many times is x compared with an element in the list. How many times would it be compared with an element in the list if we employed a linear search a ternary, rather than a binary search.
Want to see the full answer?
Check out a sample textbook solutionChapter 8 Solutions
Discrete Mathematics with Graph Theory (Classic Version) (3rd Edition) (Pearson Modern Classics for Advanced Mathematics Series)
- Discrete Math Q. Consider your ID: AB-CDEFG-H(21-45194-2). Now construct a BST(Binary Search tree) using the numbers below A, B, C, D, E, F, G, Harrow_forwardUse the binary exponentiation algorithm to compute the remainder when 385 is divided by 53.arrow_forwardHow to do standard algorithm?arrow_forward
- What is the use of the Euclidean algorithm?arrow_forwardLupe and Erik continue to argue about Chevrolet and Ford, and try to determine which is better. Lupe finds a Chevrolet will lose 18.3% of its value every year for its first 15 years. Erik determines that Ford is able to keep 81.8% of its value every year for its first 15 years. Assume that each value is at $25,000.00. a) Write a recursive rule for each Chevrolet and Ford. b) Write a closed-form function rule that models the value of the Brand on a yearly basisarrow_forwardShow how to use the “slide method” (“birthday cake” algorithm) to determine both the GCF and LCM of 3240 and 3780.arrow_forward
- You are looking for an item in an ordered list 450,000 items long (the length of Webster’s Third New International Dictionary). How many steps might it take to find the item with a sequential search? A binary search?arrow_forwardFill up the table and by nearest neighbor algorithm’sarrow_forwardFill in the blanks (the dashed boxes) below to show how to do the partial products algorithm for 41 x 95. 41 x 95arrow_forward
- Information about ocean weather can be extracted from radar returns with the aid of a special algorithm. A study is conducted to estimate the difference in wind speed as measured on the ground and via the Seasat satellite. To do so, wind speeds (miles per hour) are measured on the ground and via the Seasat satellite simultaneously at 12 special times. The data is shown in the following table. The table also shows the difference between the wind speed on the ground and that via the Seasat satellite at each time, as well as some summary statistics. Difference Time Ground (x) Satellite (y) d = x – y 1 4.46 4.08 0.38 3.99 3.94 0.05 3.73 5.00 -1.27 4 3.29 5.20 -1.91 4.82 3.92 0.90 6. 6.71 6.21 0.50 7 4.61 5.95 -1.34 8 3.87 3.07 0.80 9. 3.17 4.76 -1.59 10 4.42 3.25 1.17 11 3.76 4.89 -1.13 12 3.30 4.80 -1.50 d = -0.41 Sd = 1.14arrow_forwardPlease use Dr.Racket: How can we express Mid-Square hashing for racket program?arrow_forwardTwo forms of the Division Algorithm are shown.Identify and label each term or function.arrow_forward
- College Algebra (MindTap Course List)AlgebraISBN:9781305652231Author:R. David Gustafson, Jeff HughesPublisher:Cengage Learning