Trees Flashcards

1
Q

What is a tree?

A

A data structure that consist of nodes in a parent-child relationship. This means node can reference multiple nodes.

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

What is the difference between trees and linked list.

A

Linked list are linear where trees are not.

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

What are the rules for trees?

A

1 - A node can not a reference another node that is not a child.
2 - A child node cannot point to its parent.
3 - There must be a root node.

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

What is a leaf?

A

A node with no children.

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

What is a edge?

A

A connection between one node another.

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

What is a sibling?

A

A group of nodes with the same parent.

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

What are the use cases?

A

1 - HTML DOM
2 - Network Routing
3 - AI
4 - Operating System Files

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

What are the different types of trees?

A

There is binary trees, ternary trees, and N-ary trees.

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