binary trees Flashcards

1
Q

What is the depth of a tree?

A

The depth of a tree is the maximum depth of any leaf node.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the characteristics of a full binary tree?

A
  1. Every leaf node is at the same depth.
  2. Each non-leaf node has two children.
  3. A full binary tree of depth n has: 2^n leaves, 2^(n+1) - 1 nodes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the characteristics of a complete binary tree?

A

All levels are fully filled except possibly the last. Nodes at the deepest level are as far left as possible.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How many leaves and total nodes can a complete binary tree of depth n have?

A

At most 2^n leaves, Up to 2^(n+1) - 1 nodes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What’s the difference between a full binary tree and a complete binary tree?

A

A full binary tree has all leaves at the same depth and every non-leaf node has exactly two children. A complete binary tree may have a partially filled last level, but the nodes are as far left as possible.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How many leaves and total nodes are in a full binary tree of depth n?

A

A full binary tree of depth n has exactly 2^n leaves and up to 2^(n+1) - 1 nodes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly