CS1132_Fall_2011_Lecture5_BB

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

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

View Full Document Right Arrow Icon
CS 103 1 Lecture 5 Trees ( Chapter 9 ) Trees –General definitions Binary Search Tree Complexity of Binary Search Tree
Background image of page 1

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

View Full DocumentRight Arrow Icon
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
Background image of page 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
Background image of page 3

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

View Full DocumentRight Arrow Icon
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
Background image of page 4
Dynamic Trees Examples: Priority Queues and Heaps – trees can be used as a different data representation to improve performance CS 103 5
Background image of page 5

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

View Full DocumentRight Arrow Icon
Data Representation of Trees Sequential representation Linked list representation CS 103 6
Background image of page 6
Basic Tree Terminologies Root, Children & Descendants Levels & Leaves CS 103 7
Background image of page 7

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

View Full DocumentRight Arrow Icon
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
Background image of page 8
9 More Basic Tree Terminologies Trees are rooted. Once the root is defined (by the user) all nodes have a specific level . Trees have
Background image of page 9

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

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

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