Introduction to Algorithms
Introduction to Algorithms
3rd Edition
ISBN: 9780262033848
Author: Thomas H. Cormen, Ronald L. Rivest, Charles E. Leiserson, Clifford Stein
Publisher: MIT Press
bartleby

Concept explainers

Question
Book Icon
Chapter 9, Problem 3P

(a)

Program Plan Intro

To describe an algorithm that uses Ui(n) comparisons to find the ith smallest of n -elements where Ui(n)={T(n)n/2+Ui(n/2)+T(2i)in/2otherwise} .

(b)

Program Plan Intro

To show that Ui(n)=n+O(T(2i)lg(n/i)) if i<n/2 .

(c)

Program Plan Intro

To show that Ui(n)=n+O(lgn) if i is a constant less than n/2 .

(d)

Program Plan Intro

To show that Ui(n)=n+O(T(2n/k)lgk) if i=n/k for k2 .

Blurred answer
Students have asked these similar questions
The Gale-Shapley algorithm is upper bounded by ≤ n^2 for n men and n women, since each man can only make ≤n proposals.However, we haven’t shown a lower bound on number of iterations. To show the lower bound is also inthe order of n^2, please give a way to construct the preference lists for n men and n women such that theGale-Shapley algorithm will run for Θ(n^2) iterations. (For simplicity, you can assume that the algorithmalways chooses the unmatched man with the smallest index at each iteration).
The algorithm of Euclid computes the greatest common divisor (GCD) of two integer numbers a and b. The following pseudo-code is the original version of this algorithm.  Algorithm Euclid(a,b)Require: a, b ≥ 0Ensure: a = GCD(a, b)    while b ̸= 0 do        t ← b        b ← a mod b        a ← tend whilereturn a We want to estimate its worst case running time using the big-Oh notation. Answer the following questions: a. Let x be a integer stored on n bits. How many bits will you need to store x/2? b. We note that if a ≥ b, then a mod b < a/2. Assume the values of the input integers a and b are encoded on n bits. How many bits will be used to store the values of a and b at the next iteration of the While loop? c. Deduce from this observation, the maximal number iterations of the While loop the algorithm will do.
Suppose that I searched for a number x in a sorted list of n items by comparing against the 5th item, then the 10th, then the 15th, etc. until I found an item bigger than x, and then I searched backwards from that point. Which expression best describes the approximate running time of this algorithm:
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education