CS2134 Midterm 2 Notes

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

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

View Full Document Right Arrow Icon
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)
Background image of page 1

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

View Full DocumentRight Arrow Icon
- 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. -
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

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 Right Arrow Icon
Ask a homework question - tutors are online