lec19a - Trees Nature Lovers View Of A Tree root branches...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: Trees Nature Lovers View Of A Tree root branches leaves Computer Scientists View branches leaves root nodes Linear Lists And Trees Linear lists are useful for serially ordered data. (e , 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. Javas classes. Object is at the top of the hierarchy. Subclasses of Object are next, and so on. 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 . Tree Nodes Path is a sequence (a,b,,c,d,,e) of nodes in tree where a is the parent or child of b,, c is the parent or child of d, etc. Children, grandchildren, etc. are descendants Nodes on path to root are ancestors great grand child of root grand children of root children of root Javas Classes (Part Of Figure 1.1) Object Number Throwable OutputStream Integer Double Exception FileOutputStream RuntimeException root 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 . Subtrees Object Number Throwable OutputStream Integer Double Exception FileOutputStream RuntimeException root Leaves Object Number Throwable OutputStream Integer Double Exception FileOutputStream RuntimeException Parent, Grandparent, Siblings, Ancestors, Descendants Object Number Throwable OutputStream Integer Double Exception FileOutputStream RuntimeException Level 4 Level 3 Level 2 Levels...
View Full Document

This note was uploaded on 01/18/2012 for the course COP 3530 taught by Professor Davis during the Fall '08 term at University of Florida.

Page1 / 40

lec19a - Trees Nature Lovers View Of A Tree root branches...

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