7_trees

# 7_trees - Introduction to Computers and Programming Prof I...

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

Introduction to Computers and Programming Prof. I. K. Lundqvist Lecture 7 April 2 2004 Concept Question 1. Both G1 and G2 are Graphs 2. Only G1 is a Graph 3. Only G2 is a Graph 4. Neither G1 nor G2 are Graphs G1(V1,E1) where V1 = {}, E1 = {} G2(V2,E2) where V2 = {a,b}, E2 = {} A graph G(V, E) is a finite nonempty set of vertices and a set of edges G1(V1,E1) where V1 = {}, E1 = {} G2(V2,E2) where V2 = {a,b}, E2 = {}

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

View Full Document
[Theorem] Theorem : a mathematical statement that can be shown to be true – Can be proved using other theorems, axioms (statements which are given to be true) and rules of inference Lemma : a pre-theorem or result needed to prove a theorem Corollary : post-theorem or result which follows directly from a theorem • Proposition •C la im •Rema rk Why should we use trees? 4 2 15 9 5 7 5 4 2 9 7 15 Binary Search Tree
5 A tree is a connected undirected graph with no simple circuits. – it cannot contain multiple edges or loops Trees Theorem : An undirected graph is a tree if and only if there is a unique simple path between any two of its vertices. 6 Which graphs are trees? a) b) c) d)

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

View Full Document
Rooted Tree • A directed graph G is called a rooted tree if there exists a vertex u so that for each v V, there is exactly one path between u and v – The in-degree of u is 0 and the in-degree of all other vertices is 1 • For an undirected graph, different choices of the root produces different trees Choice of Root a g d f e c b a g b d e f c b c a dg f e Examples of Rooted Trees?
9 • A vertex that has children is called an

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 01/28/2012 for the course AERO 16.01 taught by Professor Markdrela during the Fall '05 term at MIT.

### Page1 / 14

7_trees - Introduction to Computers and Programming Prof I...

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

View Full Document
Ask a homework question - tutors are online