Ch5-tree-01 - Trees CAU data structure 2011 Spring 1 Nature Lovers View Of A Tree leaves branches root CAU data structure 2011 Spring 2 Computer

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

View Full Document Right Arrow Icon
Trees 1 CAU data structure 2011 Spring
Background image of page 1

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

View Full DocumentRight Arrow Icon
Nature Lover’s View Of A Tree root branches leaves 2 CAU data structure 2011 Spring
Background image of page 2
Computer Scientist’s View branches leaves root nodes 3 CAU data structure 2011 Spring
Background image of page 3

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

View Full DocumentRight Arrow Icon
Linear Lists And Trees Linear lists are useful for serially ordered data. (e 0 , e 1 , e 2 , …, e n-1 ) Days of week. Months in a year. Students in this class. Trees are useful for hierarchically ordered data. Employees of a corporation. President, vice presidents, managers, and so on. 4 CAU data structure 2011 Spring
Background image of page 4
Hierarchical Data And Trees The element at the top of the hierarchy is the root . Elements next in the hierarchy are the children of the root. Elements next in the hierarchy are the grandchildren of the root, and so on. Elements that have no children are leaves . 5 CAU data structure 2011 Spring
Background image of page 5

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

View Full DocumentRight Arrow Icon
great grand child of root grand children of root children of root Example Tree President VP1 VP2 VP3 Manager1 Manager2 Manager Manager Worker Bee root 6 CAU data structure 2011 Spring
Background image of page 6
Definition A tree t is a finite nonempty set of elements. One of these elements is called the root. The remaining elements, if any, are partitioned into trees, which are called the subtrees of t . 7 CAU data structure 2011 Spring
Background image of page 7

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

View Full DocumentRight Arrow Icon
Subtrees President VP1 VP2 VP3 Manager1 Manager2 Manager Manager Worker Bee root 8 CAU data structure 2011 Spring
Background image of page 8
Leaves President VP1 VP2 VP3 Manager1 Manager2 Manager Manager Worker Bee 9 CAU data structure 2011 Spring
Background image of page 9

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

View Full DocumentRight Arrow Icon
Parent, Grandparent, Siblings, Ancestors, Descendants President VP1 VP2 VP3 Manager2 Manager Manager Worker Bee Manager1 10 CAU data structure 2011 Spring
Background image of page 10
Level 4 Level 3 Level 2 Levels President VP1 VP2 VP3 Manager1 Manager2 Manager Manager Worker Bee Level 1 11 CAU data structure 2011 Spring
Background image of page 11

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

View Full DocumentRight Arrow Icon
Caution Some texts start level numbers at 0 rather than at 1 . Root is at level
Background image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/13/2011 for the course DATA STRUC 101 taught by Professor Hansanyong during the Spring '11 term at 한동대학교.

Page1 / 41

Ch5-tree-01 - Trees CAU data structure 2011 Spring 1 Nature Lovers View Of A Tree leaves branches root CAU data structure 2011 Spring 2 Computer

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online