Trees Flashcards

1
Q

Are inorder, preorder, and postorder classed as depth-first search, or breadth first search?

A

Depth-first search

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

What kind of traversal is used to delete the tree?

A

Postorder

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

Postorder traversal is used to get the _________ expression of an expression tree.

A

Postfix

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

Preorder traversal is used to get the _________ expression of an expression tree.

A

prefix

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

Postorder traversal can help in ________ collection algorithms, particularly in systems where _____________ is used.

A

garbage; manual memory management

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

What order are nodes visited in POSTORDER traversal?

A

left, right, root

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

What order are nodes visited in PREORDER traversal?

A

root, left, right

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

What order are nodes visited in INORDER traversal?

A

left, root, right

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

What kind of traversal is used to create a copy of a tree?

A

Preorder

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

Inorder traversal gives nodes in ___________ order.

A

non-decreasing order

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

When REVERSED, Inorder traversal gives nodes in ___________ order.

A

non-increasing

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

A tree with n nodes has _______ links/edges.

A

n-1

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

A tree is a(n) __________ and _________ graph.

A

undirected; acyclic
(no cycles or loops, every node can be the root node of its own subtree)

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

What is the level/depth of a tree?

A

Number of edges along the unique path between a node and the root node

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

The height of the root node is automatically the _________________________________________________

A

height of the entire tree itself

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