(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
- 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_forwardInformation 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_forwardPls help me with this Discrete Mathematics question asap, thank youarrow_forward
- Compute r2arrow_forwardhow do you determine coterminals?arrow_forwardWithout doing any computation, explain why C(10, 4)+C(10, 5) = C(11, 5). Hint: Suppose that a committee of size five is to be chosen from a pool of 11 people, and John Doe is one of the people. How many committees are there that include John? How many committees are there that don't include John?arrow_forward
- Algebra & Trigonometry with Analytic GeometryAlgebraISBN:9781133382119Author:SwokowskiPublisher:CengageCollege Algebra (MindTap Course List)AlgebraISBN:9781305652231Author:R. David Gustafson, Jeff HughesPublisher:Cengage LearningHolt Mcdougal Larson Pre-algebra: Student Edition...AlgebraISBN:9780547587776Author:HOLT MCDOUGALPublisher:HOLT MCDOUGAL