practice-Trees

practice-Trees - root A internal nodes ABD leaves EFCGH I...

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

View Full Document Right Arrow Icon
/ root A internal nodes A B D leaves E F C G H I height 3 level of root 0 level of node with F 2 nodes at level 1 3 parent of G, H and I D descendants of B E F CSE205- Fall 2008 Trees _Chapter 16 Last Name ________________ First _____________ Date_____ Arrays and Linked List are Linear Data structures. Every element has one unique predecessor and one unique successor (except the first and last elements). Arrays, lists, stacks, and queues all have this distinctive linear characteristic. The Tree structure presented is an exception to this linear category. Trees can help solve a variety of problems. Some tree processing algorithms will have recursive solutions because many tree operations include some steps that will process one or more subtrees. Trees A tree is often used to store large collections of data. For example, the file systems on most computers are implemented in a tree structure. Files are organized in folders, where a single folder may have multiple folders under it that contain files and possibly other folders. The collection of files and folders can be viewed as a tree. A tree is a collection of nodes with one node designated as the root . Each node references some object and has edges connecting it to other nodes, which are also trees. These other nodes are called children . A tree can be empty have no nodes. Each node in a tree has exactly one parent except for the distinctive node known as the root of the tree. The root is the top-most node in a tree. Whereas the root of a real tree is usually located in the ground and the leaves are above the root, computer scientists draw trees upside down. What a tree usually looks like.
Background image of page 1

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

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

This note was uploaded on 06/11/2009 for the course CS 205214 taught by Professor Balasooriya/kouvetakis during the Spring '09 term at ASU.

Page1 / 7

practice-Trees - root A internal nodes ABD leaves EFCGH I...

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

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