4.2.5 - FoDS (Tree) Flashcards

1
Q

What is a tree

A

A connected, undirected graph with no cycles

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

True or False:
A tree must have a root

A

False

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

What is a cycle

A

A sequence of vertices and edges that can start and end on the same vertex

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

What are 2 examples of trees

A
  • Rooted trees
  • Binary trees
  • Binary search trees
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a rooted tree

A

A tree in which one vertex has been designated as a root, creating parent-child relationships

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

What is a binary tree

A

A tree in which each node has at most 2 children

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

What is a root

A

A node with no parents

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
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
9
Q

What is a branch

A

An edge connecting nodes

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

What is the advantage of binary trees

A

Efficient sorting, searching and retrieval of data

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