This preview shows pages 1–6. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: tree with the root r . Each T i is called a subtree of T , and each r i is a child of r , and r is a parent of r i . A binary tree is a rooted tree of which each vertex has no more than 2 children. A full binary tree is a binary tree of which each vertex has either 0 or 2 children. The height h ( T ) of a rooted tree T is 1. 0 if T consists of a single vertex; February 15 Recursive structures, Page 4 13.3 Rooted trees 2. max { h ( T i ) : i = 1 ...n } + 1 if T 1 ...T n are subtrees of v . Fact. If T is a binary tree with n vertices, then n 2 h ( T )+11. February 15 Recursive structures, Page 5 13.4 Lower bound for sorting Theorem. Any sorting algorithm based on pairwise comparisons must compare n log 2 ncn times, for some constant c > 0 to sort n numbers. February 15 Recursive structures, Page 6...
View
Full
Document
 Winter '07
 YaoyunShi

Click to edit the document details