Handout 19

# Handout 19 - Mehran Sahami CS103B Handout#19 February 6...

This preview shows pages 1–2. Sign up to view the full content.

Mehran Sahami Handout #19 CS103B February 6, 2009 Practice Midterm Problems Note: the number of problems here is a larger than you will see on the actual midterm. More problems are provided here just to give you a bit more practice on a broader set of the topics that we have covered so far, but the difficulty of the individual problems given here is likely to be comparable to the mix of the difficulty of individual problems on the actual midterm (i.e., there are some straight-forward questions and some that are more challenging and involve a bit more thinking). 1. Consider the Reverse Preorder Traversal, where we traverse the right subtree before the left subtree, shown in pseudocode below: Traverse(T) { if (T is not empty) { Process(T(root)); Traverse(T(Right)); Traverse(T(Left)); } } Give the order in which nodes are processed if we were to do a reverse preorder traversal on the following tree: 2. Give a tight big-Oh bound in terms of n for the following function. Justify how you obtained your final big-Oh bound by explaining how various parts of the function

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 09/26/2009 for the course CS 103B taught by Professor Sahami,m during the Winter '08 term at Stanford.

### Page1 / 2

Handout 19 - Mehran Sahami CS103B Handout#19 February 6...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online