0
0
DSA Goprogramming~5 mins

Tree Terminology Root Leaf Height Depth Level in DSA Go - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the root of a tree?
The root is the topmost node of a tree. It has no parent and is the starting point of the tree.
Click to reveal answer
beginner
Define a leaf node in a tree.
A leaf node is a node that has no children. It is at the end of a branch.
Click to reveal answer
intermediate
What does the height of a node represent?
Height of a node is the number of edges on the longest path from that node down to a leaf.
Click to reveal answer
intermediate
Explain the depth of a node in a tree.
Depth of a node is the number of edges from the root node down to that node.
Click to reveal answer
beginner
What is the level of a node in a tree?
Level of a node is its depth plus one. The root is at level 1, its children at level 2, and so on.
Click to reveal answer
Which node has no parent in a tree?
ARoot
BLeaf
CChild
DSibling
A node with no children is called a:
ALeaf
BParent
CRoot
DAncestor
Height of a node is measured by:
AEdges from root to node
BEdges from node to leaf
CNumber of children
DNumber of siblings
Depth of a node is:
ANumber of children
BEdges from node to leaf
CEdges from root to node
DNumber of leaves
If the root is at level 1, what level are its children at?
A0
B3
C1
D2
Describe the difference between depth and height of a node in a tree.
Think about where you start counting edges for each.
You got /4 concepts.
    Explain what the level of a node means and how it relates to depth.
    Level starts counting from 1 at the root.
    You got /4 concepts.