We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2
Trees
A tree is a finite non-empty set of elements
Used to represent a hierarchical data, meaning that there is a superior-subordinate type relationship The root of a tree is the element at the highest level of the hierarchy A subtree is a smaller tree that is contained within the original tree A parent is an element that has a subordinate element A child is an element that has a superior element Siblings are child elements with the same parent Elements with no child elements are known as leaves The degree of an element is the number of children that it has The degree of a tree is the maximum of its element degree Binary Trees A binary tree is a finite collection of elements where an element has at most two subtrees (or children) The differences between a binary tree and a tree: A binary tree can be empty Each element in a binary tree has at most two subtrees, while each element in a tree can have any number of subtrees The height of a binary tree is the number of levels in it A complete binary tree is a binary tree in which each level of the tree is completely filled, with the exception of the bottom level. If the bottom level is incomplete, the nodes are in the leftmost positions A full binary tree is a binary tree where every parent node has 2 children