Binary Trees Info Flashcards
Memorize
What is a Generic method and what is it used for
a.) It is a method definiton having a special type parameter that may be used in place for types
Define what a tree is?
A tree is a set of Nodes
What is the distingushed Node in a tree if it is not empty
Root
What is the External node called in a tree?
Leaf
What is the internal node in a tree
A node with one or more children
What is a path in a tree
A path from node Vi to node Vk is a sequence of nodes such that vi+1 for 1<=i<=k
What is the length of a tree?
The length of the tree is the number of edges encountered so (k-1)
What is the depth of a tree
The depth of any node is the length of the path from the root to the node
What is an Ancestor and what is a descendant
If there is a path from V1 to V2 then V1 is ancestor of V2 and V2 is the descendant of V1
What is the height of the tree
The height of the tree is the height of its root
What does a tree node include
An element and nodes linked together
What is the Special case of K-ary Trees
it is a tree whose nodes have at mose two children pointers – binary trees
Define a Binary Tree
It is a rooted tree in which no node can have more than two children AND the children are distinguished as left and right
What is a General Binary Tree
It is a tree where each node has a most two nodes
What is a full binary Tree
A binary tree where every interior node has two children or is an external node