CS2134 Midterm 2 Notes

# CS2134 Midterm 2 Notes - Algorithm Sequential Search Binary...

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

Algorithm Running Time Sequential Search O(n) Binary Search O(log n) Selection Sort O(n 2 ) Merge Sort O(nlog n) Insertion Sort O(n 2 ) (Worst and Average Case) O(n) (Best Case) Quick Sort O(nlog n) (Average and Best Case) O(n 2 ) (Worst Case)

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

View Full Document
- The height of the tree is the number of edges through the longest path of the tree. - The size of the tree is the total number of nodes in the tree. - A FULL binary tree has 2 h – 1 internal nodes. - A FULL binary tree has 2 h leaves. - A FULL binary tree has 2 h + 1 – 1 nodes. - Pre-order Traversal (ALR) - For each node in the tree do the following steps. 1. Access or display. 2. Go left. 3. Go right. - In-order Traversal (LAR) - For each node in the tree do the following steps. 1. Go left. 2. Access or display. 3. Go right. - Post-order Traversal (LRA) - For each node in the tree do the following steps. 1. Go left. 2. Go right. 3. Access or display. -
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 05/18/2008 for the course CS 2134 taught by Professor Hellerstein during the Fall '07 term at NYU Poly.

### Page1 / 6

CS2134 Midterm 2 Notes - Algorithm Sequential Search Binary...

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

View Full Document
Ask a homework question - tutors are online