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 parents and two children max.
Click to reveal answer
beginner
How do you create a node in a binary tree manually in Go?
You define a struct with a value and two pointers for left and right children. Then you create nodes by assigning values and linking children manually.
Click to reveal answer
beginner
What does the left child pointer represent in a binary tree node?
It points to the node's left child, which is the node that comes before it in the left direction. If there is no left child, it is nil (empty).
Click to reveal answer
intermediate
Why do we use pointers for left and right children in Go binary trees?
Pointers allow nodes to link to other nodes directly. This way, the tree can grow dynamically and nodes can share connections without copying data.
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
In a binary tree, how many children can a node have at most?
✗ Incorrect
Each node in a binary tree can have up to two children: left and right.
What Go data type is commonly used to link nodes in a binary tree?
✗ Incorrect
Pointers are used to link nodes so they can reference other nodes directly.
What is the value of a child pointer if the node has no child in that direction?
✗ Incorrect
If there is no child, the pointer is nil, meaning it points to nothing.
Which node is the starting point of a binary tree?
✗ Incorrect
The root node is the top node and starting point of the tree.
How do you manually create a binary tree in Go?
✗ Incorrect
Manually creating a binary tree involves defining a node struct and linking nodes with pointers.
Explain how to create a simple binary tree manually in Go with three nodes.
Think about how you connect family members in a family tree.
You got /4 concepts.
Describe the role of pointers in building a binary tree in Go.
Pointers are like addresses that show where children live.
You got /4 concepts.