Fundamentals of Algorithms Flashcards

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

Traversal

A

The process of reading data from a tree or graph by visiting all the nodes.

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

There are two ways of traversing a graph. Name them, and explain what they do.

A

Depth First - A method that explores as far into a graph as possible before backtracking to visit unvisited nodes.

Breadth First - A method for traversing graphs that visits the nodes closest to a starting point first. A queue is used to keep track of the nodes to visit.

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

There are three ways of traversing a binary tree. Name them and explain what they do.

A

Binary Tree - A structure where each node can only have up to two child nodes attached to it.

Pre-Order - a method of traversing a tree by visiting the root, traversing the left subtree, and traversing the right subtree. Basically, Visit, Left, Right

In-Order - Left, Visit, Right (The equivalent of a binary search)

Post-Order - Left, Right, Visit

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

Recursion

A

A technique where a function can call itself in order to complete a task

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

Dijkstra’s Algorithm

A

https://www.youtube.com/watch?v=5GT5hYzjNoo

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

Linear Search

A

A simple search technique that looks through data one item at a time until the search term is found.

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

Binary Search

A

A technique for searching data that works by splitting datasets in half repeatedly until the search data is found.

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

Binary Tree Search

A

A technique for searching a binary tree that traverses the tree until a search term is found.

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

Reverse Polish Notation (RPN)

A

Another term for postfix notation

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

Infix

A

Expressions that are written with the operators within the operands, eg 2 + 3

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

Interpreter

A

Software that translates and executes programs line by line by converting programming statements either into machine code or by calling instructions to carry out the high-level language statements.

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

Prefix

A

Expressions that are written with the operators before the operands, eg + 2 3

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

Postfix

A

Expressions that are written with the operators after the operands, eg 2 3 +

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

Apply Reverse Polish Notation to these expressions:

2 + 3

(5+4)/(4-1)

A

2 3 +

5 4 + 4 1 - /

Remember, BODMAS is applied, so brackets are evaluated first.

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

Bubble Sort

A

A technique for putting data in order by repeatedly stepping through an array, comparing adjacent elements and swapping them if necessary until the array is in order.

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

Iteration

A

Repeating the same process several times in order to achieve a result.

17
Q

Merge Sort

A

A technique for putting data in order by splitting lists into single elements and then merging them back together again.