Binary Trees Flashcards

1
Q

What is a tree?

A

A form of non-linear organization datatype. “A collection of nodes connected by edges without having any cycle”.

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

What are the two main types of data organization?

A

Linear: entries/objects one after another.
Non-linear: entries/objects arranged in a hierarchy.

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

Level

A

The hierarchical level of a node.

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

Root

A

The single node at the top level.

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

Children

A

The nodes at each successive level of a tree are the children of the nodes at the previous level.

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

Parent

A

A node that has children is the parent of those children.

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

Leaf

A

A node that has no children.

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

Subtree

A

Any node and its descendants form a subtree of the original tree.

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

Sibling

A

Sibling nodes share the same parent node.

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

Edge

A

Connection between one node to another.

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

Path

A

A sequence of nodes and edges connecting a node with a descendant.

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

Height of node

A

The height of a node is the # of edges on the longest path between that node and a leaf + 1

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

Depth of node

A

The depth of a node is the # of edges from the tree’s root node to the node + 1

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

Height of tree

A

The height of a tree is the height of its root node.

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