(a)
The sequence of steps in a binary search to x= 7 in the list 3, 5, 7, 20, 12, 15, 17, 22, 24, 30, 31. 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.
(b)
The sequence of steps in a binary search to x= 30 in the list 3, 5, 7, 20, 12, 15, 17, 22, 24, 30, 31. 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.
(c)
The sequence of steps in a binary search to x= 16 in the list 3, 5, 7, 20, 12, 15, 17, 22, 24, 30, 31. 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.
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_forwardHow to do standard algorithm?arrow_forwardYou 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_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_forwardDescribe the elimination without row exchanges.arrow_forwardhow do you determine coterminals?arrow_forward
- Algebra: Structure And Method, Book 1AlgebraISBN:9780395977224Author:Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. ColePublisher:McDougal Littell