Algorithms and Big O Flashcards

1
Q

What is Dijkstra’s algorithm?

A

An algorithm for finding the shortest paths between nodes in a graph

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

What is A* algorithm?

A

An algorithm that finds the shortest path from a start node to a target node, using a heuristic to improve performance by prioritising paths that seem more promising

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

What does the Big O notation do?

A

It measures the efficiency of an algorithm

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

What is Big O?

A

A notation used to describe the performance of an algorithm as the amount of data increases

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

What is Constant Time Complexity (O(1))?

A

An algorithm whose execution time remains constant, regardless of the input size.

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

What is Linear Time Complexity (O(n))?

A

An algorithm whose execution time grows linearly with the input size.

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

What is Polynomial Time Complexity (O(n^k))?

A

An algorithm whose execution time grows proportionally to the input size raised to a constant power.

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

What is Exponential Time Complexity (O(2^n))?

A

An algorithm whose execution time doubles with each additional input element.

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

What is Logarithmic Time Complexity (O(log n))?

A

An algorithm whose execution time increases at a decreasing rate as the input size grows.

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

What is Bubble Sort?

A

A sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order.

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

What is Insertion Sort?

A

A sorting algorithm that builds the final sorted array one item at a time, placing each new element in its correct position.

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

What is Merge Sort?

A

A divide-and-conquer sorting algorithm that splits the array into halves, recursively sorts them, and then merges the sorted halves back together.

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

What is Quick Sort?

A

A divide-and-conquer sorting algorithm that selects a ‘pivot’ element and partitions the other elements into two sub-arrays, recursively sorting them.

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

What is Binary Search?

A

An algorithm for finding an item from a sorted list by repeatedly dividing the list in half.

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

What is Linear Search?

A

A search algorithm that checks every element in a list until the desired element is found or the list ends.

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

What is a Heuristic?

A

A sensible estimate of the distance to the goal node from the current node