Recall & Review
beginner
What is a binary tree node?
A binary tree node is a basic unit of a binary tree that contains data and has up to two child nodes: left and right.
Click to reveal answer
beginner
What are the main parts of a binary tree node?
A binary tree node has three main parts: <br>1. Data (value stored)<br>2. Left child (pointer to left node)<br>3. Right child (pointer to right node)
Click to reveal answer
beginner
Show a simple JavaScript class for a binary tree node.class TreeNode {<br> constructor(value) {<br> this.value = value;<br> this.left = null;<br> this.right = null;<br> }<br>}Click to reveal answer
beginner
Why do left and right children start as null in a new binary tree node?
Because when a node is created, it has no children yet. Null means no child node connected on that side.
Click to reveal answer
intermediate
How does a binary tree node differ from a linked list node?
A binary tree node has two pointers (left and right), while a linked list node has only one pointer to the next node.
Click to reveal answer
What does a binary tree node typically contain?
✗ Incorrect
A binary tree node contains data and two children pointers: left and right.
In JavaScript, how do you represent a missing child in a binary tree node?
✗ Incorrect
Null is used to show that a child node does not exist.
Which of these is NOT a part of a binary tree node?
✗ Incorrect
A basic binary tree node does not have a parent pointer.
What is the initial value of left and right children when a node is created?
✗ Incorrect
Left and right children start as null to show no children exist yet.
How many children can a binary tree node have at most?
✗ Incorrect
A binary tree node can have up to two children: left and right.
Describe the structure of a binary tree node and its parts.
Think about what each node stores and how it connects to others.
You got /4 concepts.
Write a simple JavaScript class for a binary tree node and explain why left and right start as null.
Focus on the code and the meaning of null pointers.
You got /5 concepts.