Algorithms Flashcards
In which data structure a Traversal usually happen?
A tree
What’s a node in the Tree data structure?
A node is a structure which may contain a value or condition, or represent a separate data structure.
What’s a Root in the Tree data structure?
The top node in a tree, the prime ancestor.
What’s a child in the Tree data structure?
A node directly connected to another node moving away from the root, an immediate descendant.
What’s a parent in the Tree data structure?
The inverse of a child, an immediate ancestor.
What is a leaf in the Tree data structure?
A node with no children
What is an Internal node in the Tree data structure?
A node with at least one child.
What is an edge in the Tree data structure?
The connection between one node and another
What is depth in the Tree data structure?
The distance between a node and the root
What is a level in the Tree data structure?
The number of edges between a node and the root + 1
What is the height of the Tree data structure?
The number of edges on the longest path between a node and a descendant leaf.
What is a breadth in the Tree data structure?
Is the number of leaves.
What is a subtree in the Tree data structure?
A tree T is a tree consisting of a node in T and all of its descendants in T.
What is a binary tree?
Is a tree data structure in which each node has at most two children, which are referred to as the left and right child.
What is a binary search tree? List 3 main properties of a binary search;
is a special type of binary tree which has the following properties.
The left subtree of a node contains only nodes with keys lesser than the node’s key. The right subtree of a node contains only nodes with keys greater than the node’s key. The left and right subtree each must also be a binary search tree.