2.3 Algorithms Flashcards

1
Q

Algorithm

A

“A sequence of steps designed to perform a particular task. An algorithm may be constructed to describe the operation of a complete system or to describe a particular part of it.”

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

Big O Notation

A

“Used in computer science to describe the performance or complexity of an algorithm. Big-O specifically described the worst-case scenario, and can be used to describe the execution time required or the space used (e.g. in memory or on disk) by an algorithm.”

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

Bubble Sort

A

“A simple algorithm popular with inexperienced programmers. 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
4
Q

Insertion Sort

A

“A simple sorting algorithm that builds the final sorted array (or list) one item at time. It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
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 (1 element), then each element is compared with the adjacent list to sort and merge the two adjacent lists. Finally all elements are sorted and merged.”

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

Quick Sort

A

“A type of divide and conquer algorithm which sorts the given sequence in place meaning that it doesn’t require extra storage as would be needed in a merge sort. The basic idea is dividing the sequence into two sub-lists around an element which is called the pivot such that all elements in the lower sub-list are less than the value of the pivot element and all elements in the higher sub-list are greater than the pivot element.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
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. In practice in picks an unvisited vertex with the lowest-distance, calculates the distance through it to each unvisited neighbour, and updates the neighbours distance if smaller. It the marks the visited when done with neighbours.”

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

A* Algorithm

A

“Widely used in pathfinding and graph traversal, the process of plotting an efficiently traversable path between points, called nodes. A* uses a best-first search and finds a least-cost path from a given initial node to one goal node (out of one or more possible goals). As A* traverses the graph, it follows a path of the lowest expected total cost or distance, keeping a sorted priority queue of alternate path segments along the way.”

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. A binary search involvers accessing the middle record in the file and determining if the target record has been found or, if not, if it is before or after in the sequence. This process is repeated on the part of the file where the target record is expected, until it is found.”

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

Linear Search

A

“Involves examining each entry in turn in the file until the time 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