SLR5 Algorithms Flashcards

1
Q

Breadth-first traversal

A

“A method of searching a graph where we start at a node and then explore all the neighbouring nodes first, before moving onto the next level neighbours.”

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

Depth-first traversal

A

“A method of searching a graph where we start at a node and then explore as far as possible along each branch or path before backtracking.”

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

Pre-order tree traversal

A

“This method processes all the nodes of a tree by processing the root, then recursively processing all subtrees.”

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

Post-order tree traversal

A

“This method processes all the nodes of a tree by processing all subtrees, then the root.”

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

In-order tree traversal

A

“This method processes all the nodes of a tree by recursively processing the left subtree, then the root and, finally, the right subtree.”

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

Infix form

A

“A form of mathematical notation which places the operators between the operands – e.g. 4 + 5 = 9.”

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

Reverse Polish Notation

A

“A form of mathematical notation in which every operator follows all of its operands. The importance of this in computing is that this notation does not require parentheses, is unambiguous and computers to solve equations written in this way by using stacks.”

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

Linear search

A

“Involves examining each entry in turn until a match is found or the end of the file is reached. Unless the file is in some useful order, a serial search has to be used.”

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

Binary search

A

“A particularly efficient search method. It only works if records in the file are in sequence. It involves accessing the middle record and determining if the target has been found. If not, the search determines whether the target is before or after the middle record in the sequence. This process is repeated in the area where the target record is expected to be until it is found.”

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

Bubble sort

A

“It is inefficient when sorting large amounts of data as the time taken is related to the square of the number of items. If 10 items take 1ms, then 100 times will take 100ms (this is 10 times the number of items and so, the time will be 102 or 100 times longer).”

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

Merge sort

A

“A type of divide and conquer algorithm that was incited by John von Neumann. First, the list is divided into the smallest unit (one element), then each element is compared with the adjacent list to sort and combine the two adjacent lists. Finally, all elements are sorted and combined.”

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

Dijkstra’s shortest path

A

“A graph search algorithm that solves the single-source shortest-path problem for a graph with non-negative edge path costs, producing a shortest-path tree. This algorithm is often used in routing and as a subroutine in other graph algorithms. It picks the vertex at the shortest distance, calculates the distance to each unvisited neighbour, and updates the neighbours’ distance if smaller. It then marks the visited vertex when done with neighbours.”

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

“A method of searching a graph where we start at a node and then explore all the neighbouring nodes first, before moving onto the next level neighbours.”

A

Breadth-first traversal

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

“A method of searching a graph where we start at a node and then explore as far as possible along each branch or path before backtracking.”

A

Depth-first traversal

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

“This method processes all the nodes of a tree by processing the root, then recursively processing all subtrees.”

A

Pre-order tree traversal

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

“This method processes all the nodes of a tree by processing all subtrees, then the root.”

A

Post-order tree traversal

17
Q

“This method processes all the nodes of a tree by recursively processing the left subtree, then the root and, finally, the right subtree.”

A

In-order tree traversal

18
Q

“A form of mathematical notation which places the operators between the operands – e.g. 4 + 5 = 9.”

A

Infix form

19
Q

“A form of mathematical notation in which every operator follows all of its operands. The importance of this in computing is that this notation does not require parentheses, is unambiguous and computers to solve equations written in this way by using stacks.”

A

Reverse Polish Notation

20
Q

“Involves examining each entry in turn until a match is found or the end of the file is reached. Unless the file is in some useful order, a serial search has to be used.”

A

Linear search

21
Q

“A particularly efficient search method. It only works if records in the file are in sequence. It involves accessing the middle record and determining if the target has been found. If not, the search determines whether the target is before or after the middle record in the sequence. This process is repeated in the area where the target record is expected to be until it is found.”

A

Binary search

22
Q

“It is inefficient when sorting large amounts of data as the time taken is related to the square of the number of items. If 10 items take 1ms, then 100 times will take 100ms (this is 10 times the number of items and so, the time will be 102 or 100 times longer).”

A

Bubble sort

23
Q

“A type of divide and conquer algorithm that was incited by John von Neumann. First, the list is divided into the smallest unit (one element), then each element is compared with the adjacent list to sort and combine the two adjacent lists. Finally, all elements are sorted and combined.”

A

Merge sort

24
Q

“A graph search algorithm that solves the single-source shortest-path problem for a graph with non-negative edge path costs, producing a shortest-path tree. This algorithm is often used in routing and as a subroutine in other graph algorithms. It picks the vertex at the shortest distance, calculates the distance to each unvisited neighbour, and updates the neighbours’ distance if smaller. It then marks the visited vertex when done with neighbours.”

A

Dijkstra’s shortest path