Lesson 6: Trees Flashcards
Tree is a __________ data structure. (choices: linear, non-linear)
non-linear
Tree imposes a __________ structure, on a collection of items
Hierarchial
collection of nodes
Tree
If not empty, a tree consists of: (clue: RSE)
node R (the ROOT)
zero or more non-empty SUBTREES
each subtree is connected by a directed EDGE from R
[Tree Terminologies]
—mother node of a tree structure
—does not have parent
—first node in hierarchical arrangement
Root
[Tree Terminologies]
—stores the data and its role is the same as in the linked list
—connected by the means of links with other nodes
Node
[Tree Terminologies] immediate predecessor of a node
Parent
[Tree Terminologies] When a predecessor of a node is parent then all successor nodes are called __________ nodes.
Child
[Tree Terminologies]
—connects the two nodes
—pointer to node in a tree structure
Link/Edge
[Tree Terminologies]
—locates at the end of the tree
—does not have any child
Leaf
[Tree Terminologies] The highest number of nodes that is possible in a way starting from the first node (ROOT) to a leaf node
Height
[Tree Terminologies] rank of tree hierarchy
Level
[Tree Terminologies] the level of the root node
Level 0
[Tree Terminologies] The child node of same parent
Sibling
[Tree Terminologies] Another term for sibling nodes
Brother nodes
[Tree Terminologies] The maximum number of children that exists for a node
Degree of a Node
[Tree Terminologies] The node with degree zero
Terminal node
[Tree Terminologies] number of successive edges from source node to destination node
Path length
[Tree Terminologies] maximum level of any leaf of a tree
Depth
[Tree Terminologies] group of disjoint trees
Forest
any node that has at least one non-empty child
internal node
Simplest form of tree
Binary Tree
A binary tree consists of: (clue: NS)
NODE (root node)
SUBTREES (left and right)
A tree is binary if each node has a maximum of __________ branches.
Two
When every non-leaf node in binary tree is filled with left and right sub-trees, the tree is called ____________
Strictly binary tree
A tree in which each level of the tree is completely filled, except the bottom level
Complete binary tree
Operations on Binary Tree (clue: CELRPSIDSCT)
Create
Empty
Lchild
Rchild
Parent/Father
Sibling
Insert
Deletion
Search
Copy
Tree Traversal
[Operations on Binary Tree] create an empty binary tree
Create
[Operations on Binary Tree] return true when binary tree is empty, else return false
Empty