   Chapter 11.5, Problem 19ES ### Discrete Mathematics With Applicat...

5th Edition
EPP + 1 other
ISBN: 9781337694193

#### Solutions

Chapter
Section ### Discrete Mathematics With Applicat...

5th Edition
EPP + 1 other
ISBN: 9781337694193
Textbook Problem
1 views

# Let w n be the number of iterations of the while loop in a worst-case execution of the modified binary search algorithm for an input array of length n. Show that w k = 1 + w ⌊ k / 2 ⌋ for k ≥ 2 .

To determine

Show that wk=1+wk/2 for k = 2.

Explanation

Given information:

Let wn be the number of iterations of the while loop in a worst-case execution of the modified binary search algorithm for an input array of length n.

Proof:

wn= Number of iterations of the while-loop in worst case execution of the modified binary search algorithm when the input to the while-loop is an array with n elements

By the previous exercise, we know that when the input to the while-loop is an array with k elements, then the input on the next iteration of while-loop is an array of length at most k2

### Still sussing out bartleby?

Check out a sample textbook solution.

See a sample solution

#### The Solution to Your Study Problems

Bartleby provides explanations to thousands of textbook problems written by our experts, many with advanced degrees!

Get Started 