(a)
Trace the action of the binary search algorithm (Algorithm11.5.1) on the variables index, bot, top, mid, and thegiven values of x for the input array a [1] = Chia, a [2] = Doug, a [3] = Jan, a [4] = Jim, a [5] = José, a [6] = Mary, a [7] = Rob, a [8] = Roy, a [9] = Sue, a [10] = Usha, where alphabeticalordering is used to compare elements of the array.
(b)
Trace the action of the binary search algorithm (Algorithm11.5.1) on the variables index, bot, top, mid, and thegiven values of x for the input array a [1] = Chia, a [2] = Doug, a [3] = Jan, a [4] = Jim, a [5] = José, a [6] = Mary, a [7] = Rob, a [8] = Roy, a [9] = Sue, a [10] = Usha, where alphabeticalordering is used to compare elements of the array.
Want to see the full answer?
Check out a sample textbook solutionChapter 11 Solutions
WEBASSIGN F/EPPS DISCRETE MATHEMATICS
- 7. [10 marks] Let G = (V,E) be a 3-connected graph with at least 6 vertices. Let C be a cycle in G of length 5. We show how to find a longer cycle in G. (a) Let x be a vertex of G that is not on C. Show that there are three C-paths Po, P1, P2 that are disjoint except at the shared initial vertex and only intersect C at their final vertices. (b) Show that at least two of P0, P1, P2 have final vertices that are adjacent along C. (c) Combine two of Po, P1, P2 with C to produce a cycle in G that is longer than C.arrow_forward1. Let X and Y be random variables and suppose that A = F. Prove that Z XI(A)+YI(A) is a random variable.arrow_forward30. (a) What is meant by the term "product measur"? ANDarrow_forward
- 14. Define X-(H) for a given H E R. Provide a simple example.arrow_forwardLet G be a connected graph with n ≥ 2 vertices. Let A be the adjacency matrix of G. Prove that the diameter of G is the least number d such that all the non-diagonal entries of the matrix A are positive.arrow_forwardfind the general soultion (D-DxDy-2Dx)Z = sin(3x+4y) + x²yarrow_forward
- 3. Show that (a) If X is a random variable, then so is |X|;arrow_forward8. [10 marks] Suppose that 15 people are at a dinner and that each person knows at least 9 of the others. Can the diners be seated around a circular table so that each person knows both of their immediate neighbors? Explain why your answer is correct.arrow_forwarddx Y+2 h dy x + Z " dz X+Z find three Soultion indeparedarrow_forward
- Elements Of Modern AlgebraAlgebraISBN:9781285463230Author:Gilbert, Linda, JimmiePublisher:Cengage Learning,Linear Algebra: A Modern IntroductionAlgebraISBN:9781285463247Author:David PoolePublisher:Cengage Learning