CS1132_Fall_2011_Lecture5_BB

# CS1132_Fall_2011_Lecture5_BB - Lecture 5 Trees(Chapter 9...

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

CS 103 1 Lecture 5 Trees ( Chapter 9 ) Trees –General definitions Binary Search Tree Complexity of Binary Search Tree

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

View Full Document
Trees Trees are one of the most important data structures. Trees provide natural representation for many kinds of data that occure in applications. CS 103 2
Trees Static Trees : The shape of the tree is determined before the running of the algorithm and does not change during running. Dynamic Trees: The shape of the tree can change as a result of inserting and deleting nodes. CS 103 3

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

View Full Document
Dynamic Trees Examples: Expression – each node will be an expression Game tree – each node will represent a state of the game Search tree – each node will be associated with a search key CS 103 4
Dynamic Trees Examples: Priority Queues and Heaps – trees can be used as a different data representation to improve performance CS 103 5

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

View Full Document
Data Representation of Trees Sequential representation Linked list representation CS 103 6
Basic Tree Terminologies Root, Children & Descendants Levels & Leaves CS 103 7

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

View Full Document
8 More Basic Tree Terminologies Trees have nodes . They also have edges that connect the nodes. Between two nodes there is always only one path. Tree nodes Tree edges
9 More Basic Tree Terminologies Trees are rooted. Once the root is defined (by the user) all nodes have a specific level . Trees have

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 11/14/2011 for the course CSCI 1132 taught by Professor Haya during the Fall '11 term at GWU.

### Page1 / 29

CS1132_Fall_2011_Lecture5_BB - Lecture 5 Trees(Chapter 9...

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

View Full Document
Ask a homework question - tutors are online