Вы находитесь на странице: 1из 5

TREE STRUCTURE

 Tree is a widely used abstract data type (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 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.
 a Tree can be defined abstractly as a whole globally as an ordered tree, with a value assigned to each node. Both these
perspectives are useful: while a tree can be analyzed mathematically as a whole, when actually represented as a data structure
it is usually represented and worked with separately by node rather than as a set of nodes and an adjacency list of edges
between nodes, as one may represent a digraph, for instance
BINARY TREE STRUCTURE

 A binary tree is a tree data structure in which each node has at most two children, which are referred to as the left child and
the right child. A recursive definition using just set theory notions is that a (non-empty) binary tree is a tuple (L, S, R),
where L and R are binary trees or the empty set and S is a singleton set. Some authors allow the binary tree to be the empty set
as well.
 A binary tree may thus be also called a bifurcating arborescence - a term which appears in some very old programming
books, before the modern computer science terminology prevailed.
BINARY SEARCH TREE STRUCTURE

 Binary Search Tree is a node-based binary tree data structure which has the following properties:
o The left subtree of a node contains only nodes with keys lesser than the node’s key.
o The right subtree of a node contains only nodes with keys greater than the node’s key.
o The left and right subtree each must also be a binary search tree.
 A binary search tree (BST), also known as an ordered binary tree, is a node-based data structure in which each node has no
more than two child nodes. Each child must either be a leaf node or the root of another binary search tree. The left sub-tree
contains only nodes with keys less than the parent node; the right sub-tree contains only nodes with keys greater than the parent
node.
TERMINOLOGIES
1. Root - A root node is either the topmost or the bottom node in a tree data structure, depending on how the tree is represented
visually. The root node may be considered the top if the visual representation is top-down or the bottom if it is bottom-up. The
analogy is that the tree starts at the roots and then goes up to its crown, so the first node is considered the root.
2. Edge -The edges of a tree are known as branches. Elements of trees are called their nodes. The nodes without child nodes are
called leaf nodes.
3. Parent - A binary tree is made of nodes, where each node contains a "left" reference, a "right" reference, and a data element.
The topmost node in the tree is called the root. ... Nodes with the same parent are called siblings. More tree terminology: The
depth of a node is the number of edges from the root to the node
4. Child − The node below a given node connected by its edge downward is called its child node.
5. Siblings -"Sibling" ("brother" or "sister") nodes share the same parent node. A node's "uncles" (sometimes "ommers") are
siblings of that node's parent. A node that is connected to all lower-level nodes is called an "ancestor".
6. Leaf − The node which does not have any child node is called the leaf node.
7. Internal node - An internal node (also known as an inner node, inode for short, or branch node) is any node of a tree that has
child nodes.
8. Degree - the degree of a node in a network is the number of connections it has to other nodes and the degree distribution is the
probability distribution of these degrees over the whole network.
9. Levels − Level of a node represents the generation of a node. If the root node is at level 0, then its next child node is at level 1,
its grandchild is at level 2, and so on.
10. Height- The height of a node is the number of edges on the longest path from the node to a leaf. A leaf node will have a height
of 0.
11. Depth - The depth of a node is the number of edges from the node to the tree's root node. A root node will have a depth of 0.
12. Path − Path refers to the sequence of nodes along the edges of a tree.
13. Subtree − Subtree represents the descendants of a node.
14. Traversing − Traversing means passing through nodes in a specific order.
15. Visiting − Visiting refers to checking the value of a node when control is on the node.
TREE DATA
STRUCTURES
(DATA STRUCTURES AND ALGORITHMS)

PREPARED BY
ANGELES, BRITZ B.
TOLEDO, MARK IVAN E.

BSIT – 2A

October 25, 2019

Вам также может понравиться