LearnThatStack Ace your next interview
Trees, BSTs & Heaps · question
Question 3 of 76

What is a binary tree, and how does it differ from a general tree?

beginner
← All Trees, BSTs & Heaps questions
Re-explain

A binary tree limits each node to at most two children, usually named left and right. A general tree lets a node have any number of children, with no fixed slots.

That cap changes how you store and walk the structure. Each node needs just two child pointers, and left versus right becomes meaningful. This ordering is what later lets binary search trees and heaps assign meaning to sides.

An empty spot matters too. A node can have a left child but no right, and that gap is part of the shape.

General trees suit data with variable fan-out, like a folder holding any number of files. Binary trees suit ordered decisions, where each step picks one of two directions, and most fast lookup and priority structures build on that form.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

The diagram below the answer is the concept . Jump to it ↓

Tailored explanation · switch back to · ·
What should the new diagram focus on?
Guided practice for Trees, BSTs & Heaps One question at a time. Answer out loud, get graded, see what you missed.
How well did you know this?
AI:

Saved in this browser - sign in to keep your review list.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Interview lens How interviewers actually use this question

Likely follow-ups

What you can say

  1. A binary tree caps each node at two children, named left and right, while a general tree lets a node have any number of children with no fixed slots.
  2. That cap changes how you store it, because each node needs just two child pointers.
  3. Left and right also mean different things, and that's what later lets a binary search tree send smaller keys left and larger keys right.
  4. An empty slot is part of the shape too, so a node with only a left child is a different tree from one with only a right child.
  5. I'd pick a general tree for data with variable fan-out, like a folder that can hold any number of files.
  6. Binary trees fit ordered decisions where each step goes one of two ways, which is why most fast lookup and priority structures build on them, but they're a poor match for that folder case.

Weak answers to avoid

  • Says a binary tree is a binary search tree A binary tree has no ordering rule. A BST adds one. Say the binary tree fixes two slots, and the BST is what gives the sides a meaning.
  • Stops at two children versus many That is only the definition. Say what the cap changes: two child pointers per node, left and right that mean different things, and when each tree fits.
  • Treats left and right as interchangeable A lone left child and a lone right child make two different binary trees. Ignoring that breaks BST logic and any serialization that drops empty slots.
  • Says every node must have exactly two children The limit is at most two. Leaves have none and a node can have one. Zero or two children describes a full binary tree, which is a narrower case.
Interview lens

Likely follow-ups, what you can say, and the weak answers to avoid.

Sign in free to open it Free account - the lens opens as soon as you're back.

Want a quick review of the fundamentals? See the Trees, BSTs & Heaps cheatsheet.

← Back to all Trees, BSTs & Heaps questions
Pro · $10/mo

65 of 76 Trees, BSTs & Heaps answers are in Pro.

Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.

  • Full answers + code
  • AI explanations, simpler or deeper
  • 1,000 AI credits / month
  • Cancel anytime