0
0
DSA Javascriptprogramming~5 mins

Create a Binary Tree Manually in DSA Javascript - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a binary tree?
A binary tree is a structure where each node has up to two children called left and right. It looks like a family tree with each parent having at most two kids.
Click to reveal answer
beginner
How do you create a node in a binary tree manually?
You create a node by making an object with a value and two pointers: left and right. Both pointers start as null because the node has no children yet.
Click to reveal answer
beginner
What does the 'left' pointer in a binary tree node represent?
The 'left' pointer points to the left child node. If there is no left child, it is null.
Click to reveal answer
beginner
What is the root node in a binary tree?
The root node is the top node of the tree. It has no parent and is the starting point to access all other nodes.
Click to reveal answer
beginner
How do you link nodes to form a binary tree manually?
You assign the left and right pointers of a node to other nodes to connect them. This builds the tree structure step by step.
Click to reveal answer
What is the maximum number of children a node can have in a binary tree?
AOne
BUnlimited
CThree
DTwo
What is the initial value of left and right pointers when creating a new node manually?
AUndefined
BNull
CZero
DEmpty string
Which node is called the root in a binary tree?
AThe top node with no parent
BAny leaf node
CThe bottom-most node
DA node with two children
How do you connect nodes to form a binary tree manually?
ABy deleting nodes
BBy copying node values
CBy assigning left and right pointers
DBy swapping nodes
If a node has no left child, what is the left pointer value?
ANull
BZero
CUndefined
DEmpty string
Explain how to create a simple binary tree manually with three nodes.
Think about making three boxes and linking them with arrows for left and right.
You got /3 concepts.
    Describe the role of left and right pointers in a binary tree node.
    Imagine each node as a person holding hands with up to two children.
    You got /3 concepts.