Tree

From Computer Science Wiki
Revision as of 15:27, 5 December 2016 by Mr. MacKenty (talk | contribs) (Created page with "right|frame|Programming basics<ref>http://www.flaticon.com/</ref> In computer science, a tree is a widely used abstract data type (ADT)—or data structur...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Programming basics[1]

In computer science, a tree is a widely used abstract data type (ADT)—or data structure implementing this ADT—that simulates a hierarchical tree structure, with a root value and subtrees of children with a parent node, represented as a set of linked nodes.

A tree data structure can be defined recursively (locally) as a collection of nodes (starting at a root node), where each node is a data structure consisting of a value, together with a list of references to nodes (the "children"), with the constraints that no reference is duplicated, and none points to the root.[2]


Image of a queue[edit]

Data Queue.svg.png[3]

Access methods of a tree[edit]

  • enqueue
  • dequeue
  • isEmpty
  • peek

Practical applications of a tree[edit]

  • Printer queues
  • Computer modelling of physical queues (like in a supermarket)

Tree - video example[edit]

This video provides a basic introduction to trees. It also summarizes, very nicely, other data structures.

Standards[edit]

  • Describe how trees operate logically (both binary and non-binary).
  • Define the terms: parent, left-child, right-child, subtree, root and leaf.
  • State the result of inorder, postorder and preorder tree traversal.
  • Sketch binary trees.

See Also[edit]

References[edit]

  1. http://www.flaticon.com/
  2. https://en.wikipedia.org/wiki/Tree_(data_structure)
  3. This Image was created by User:Vegpuff.If you are using the image under the creative commons share alike license please credit the photo Vegpuff/Wikipedia and include a link to this page. No explicit permission is needed from me, but an email if my work has been of help to you.If you dont want to release your work under a creative commons license, please mail me at vegpuff@gmail.com or catch me at my twitter stream for a custom license. - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=7586271