Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

3 Questions on Analysis of Algorithms - Assignment III | CMPS 201, Assignments of Algorithms and Programming

Material Type: Assignment; Class: Analysis of Algorithms; Subject: Computer Science; University: University of California-Santa Cruz; Term: Unknown 1989;

Typology: Assignments

Pre 2010

Uploaded on 08/19/2009

koofers-user-j3d
koofers-user-j3d 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CMPS 201 Third Homework, Fall 04
3 problems, 30 pts, Due Tuesday, October 19
1. (10 pts) Problem 7-3 on page 161 (stooge sort).
2. (10 pts) Use an information theoretic (decision tree) argument to show that at least
2no(n) comparisons are required to merge two sorted lists Aand Beach containing
nelements. (Hint: First, get a good lower bound on the number of ways that two
n-element lists with distinct elements can be merged, you may need to approximate a
binomial coefficient.)
3. (10 pts) The total depth of the leaves in a tree is the sum over the leaves of the depth
of the leaf. Use induction to show that the total depth of every full binary tree T is at
least `(T) log `(T) where `(T) is the number of leaves in T. (Hint: In the inductive step,
find the two subtrees of Tand applying the inductive hypotheses to these trees to get a
lower bound in terms of how many internal nodes are on the left side. Then use calculus
to minimize this bound and underestimate the total depth of the leaves).
0

Partial preview of the text

Download 3 Questions on Analysis of Algorithms - Assignment III | CMPS 201 and more Assignments Algorithms and Programming in PDF only on Docsity!

CMPS 201 Third Homework, Fall 04 3 problems, 30 pts, Due Tuesday, October 19

  1. (10 pts) Problem 7-3 on page 161 (stooge sort).
  2. (10 pts) Use an information theoretic (decision tree) argument to show that at least 2 n − o(n) comparisons are required to merge two sorted lists A and B each containing n elements. (Hint: First, get a good lower bound on the number of ways that two n-element lists with distinct elements can be merged, you may need to approximate a binomial coefficient.)
  3. (10 pts) The total depth of the leaves in a tree is the sum over the leaves of the depth of the leaf. Use induction to show that the total depth of every full binary tree T is at least (T ) log(T ) where `(T ) is the number of leaves in T. (Hint: In the inductive step, find the two subtrees of T and applying the inductive hypotheses to these trees to get a lower bound in terms of how many internal nodes are on the left side. Then use calculus to minimize this bound and underestimate the total depth of the leaves).