3.1 Trees Flashcards

1
Q

What is a tree/graph

A

It is a non-linear data structure that organizes data in a hierarchical manner.

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

If a tree has n nodes, how many links will it have?

A

n-1 links

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

What is the root or root node?

A

This is the first element in a tree.

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

What is an edge?

A

This is a link that connects two nodes together.

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

What is a parent?

A

This is a node that is predecessor to other nodes or a node.

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

What is a child?

A

This is a node that is descendant to another node.

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

What are siblings?

A

These are nodes that share a parent.

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

What is a leaf node and what is another name for it?

A

It is a node without a child node, also known as an external node.

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

What is an internal node?

A

This is a node with at least one child.

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

What is the degree of a node?

A

This is the total number of children for a node.

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

What is the level of a node?

A

The root node is at level zero, its immediate children are at level 1, their immediate children are at level 2, and so on.

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

What is Height?

A

The total number of edges from a leaf node to another node is the height of that node.

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

What is the Height of a tree?

A

The height of the root node.

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

What is Depth?

A

The total number of edges from the root node to a specific node is the depth of that node.

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

What is path?

A

It is the sequence of edges and nodes from one node to another.

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

What is a subtree?

A

Each child from a node forms a subtree.

17
Q

What are some types of trees?

A
  1. Tree, 2. Binary tree, 3. Complete Binary tree, 4. Strictly Binary tree.