Section 3 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is the following calculation in reverse polish Notation: 3 * 4

A

3 4 *

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

What is the following calculation in reverse polish Notation: (5 * 2) + 7

A

5 2 * 7 +

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

What is the following calculation in reverse polish Notation: 5 * 4 + 3 * 2

A

5 4 * 3 2 * +

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

what are the benefits of RPN

A

RPN doesn’t require brackets and can be implemented easily on a stack

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

Which is faster - Binary search or Linear Search

A

Binary Search

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

What needs to be true before you can use Binary Search

A

the list needs to be sorted

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

What does pre-order mean

A

If each node is visited before both of its subtrees
Visit the root node (generally output it)
Do a pre-order traversal of the left subtree
Do a pre-order traversal of the right subtree

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

what does in-order mean?

A

If each node is visited between visiting its left and right subtrees
Do an in-order traversal of the left subtree
Visit root node (generally output this)
Do an in-order traversal of the right subtree

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

What is post-order

A

If each node is visited after its subtrees
Do a post-order traversal of the left subtree
Do a post-order traversal of the right subtree
Visit the root node (generally output this)

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

What does the Dijkstra’s Algorithm do?

A

Calculates the shortest path from a starting point to an end point.

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

Applications of the Dijkstra Algorithm

A
  • Geographical Information Systems such as satellite navigation.
  • Network routing and package switching, used to send data packages along the most efficient route
How well did you know this?
1
Not at all
2
3
4
5
Perfectly