2.3 Algorithms Flashcards

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

Big-O notation

A

Used to express the time complexity or performance of an algorithm

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

O(1) (constant line)

A

An algorithm that takes constant time to execute

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

O(n) (linear line)

A

An algorithm that’s performance will grow in proportion to the size of the data

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

O(n²) (polynomial/quadratic time)

A

An algorithm whose performance is directly proportional to the square of the size of the data set

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

O(2n) (Exponential time)

A

An algorithm where the time taken doubles with every additional item added

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

O(log n) (Logarithmic time)

A

An algorithm that will grow very slowly as the size of the data set increases

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

Linear search

A

Where data items are searched one by one until the required one is found or the end of the list is reached

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

Binary search

A

The items must be sorted. Repeatedly divided the data list in half until there is only one data item left

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

Bubble sort

A

Comparing items in a list and swapping them into size order

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

Insertion sort

A

Sorts one data item at a time

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

Merge sort

A

Uses a divide and conquer approach.
The list is divided in half repeatedly until there are sublists of only 1 element. It is then merged together into larger sublists until it is recombined into a single sorted list

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

Quick sort

A

Dividing the sequence into to 2 sublists around an element called the pivot and organises all smaller values below and larger values above. This repeats until sorted

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

Dijkstra’s shortest path

A

An algorithm designed to find the shortest path between one particular start node and another in a weighted graph

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

A* algorithm

A

Follows Dijkstra’s algorithm but uses heuristics that biases the search toward the target

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