Back to marketplace

2.3 - Algorithms

No description yet. This curated deck is ready for daily study.

Total cards: 24•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (24)

#1
Front (Question)

What two pieces of information allow you to analyse an algorithm?

Back (Answer)

● Time Complexity ● Space Complexity

#2
Front (Question)

What is meant by the time complexity of an algorithm?

Back (Answer)

The amount of time required to solve a particular problem

#3
Front (Question)

How do you measure of the time complexity?

Back (Answer)

Big-O notation

#4
Front (Question)

What does the big-O notation show?

Back (Answer)

The effectiveness of an algorithm

#5
Front (Question)

What is the Big-O notation good for?

Back (Answer)

It allows you to predict the amount of time taken to solve an algorithm given the number of items stored

#6
Front (Question)

What does a linear time complexity mean?

Back (Answer)

O(n) This is where the time taken for an algorithm increases proportionally or at the same rate with the size of the data set. For example, finding the largest number in a list. If the list size doubles, the time taken doubles.

#7
Front (Question)

What does a constant time complexity mean?

Back (Answer)

O(1) This is where the time taken for an algorithm stays the same regardless of the size of the data set. For example, printing the first letter of a string. No matter how big the string gets it won’t take longer to display the first letter.

#8
Front (Question)

What does a polynomial time complexity mean?

Back (Answer)

O(n^k) (where k>=0) This is where the time taken for an algorithm increases proportionally to n to the power of a constant. Bubble sort is an example of such an algorithm.

#9
Front (Question)

What is space complexity?

Back (Answer)

The space complexity is the amount of storage space an algorithm takes up

#10
Front (Question)

What is an algorithm?

Back (Answer)

An algorithm is a series of steps that complete a task

#11
Front (Question)

How do you reduce the space complexity?

Back (Answer)

Try to complete all of the operations on the same data set

#12
Front (Question)

How do you reduce the time complexity of an algorithm?

Back (Answer)

You reduce the amount of embedded for loops, and then reduce the amount of items you complete the operations on i.e. divide and conquer

#13
Front (Question)

What does a Logarithmic time complexity mean?

Back (Answer)

O(log n) This is where the time taken for an algorithm increases logarithmically as the data set increases. As n increases, the time taken increases at a slower rate, e.g. Binary search. The inverse of exponential growth. Scales up well as does not increase significantly with the number of data items.

#14
Front (Question)

What is the Big-O notation of a linear search algorithm?

Back (Answer)

O(n)

#15
Front (Question)

What is the Big-O notation of a binary search algorithm?

Back (Answer)

O(log(n))

#16
Front (Question)

What is the Big-O notation of a bubble sort algorithm?

Back (Answer)

O(n^2)

#17
Front (Question)

Are stacks FIFO or FILO?

Back (Answer)

FILO

#18
Front (Question)

What is the significance of the back pointer in the array representation of a queue?

Back (Answer)

Holds the location of the next available space in the queue

#19
Front (Question)

What is the purpose of the front pointer in the array representation of a queue?

Back (Answer)

Points to the space containing the first item in the queue

#20
Front (Question)

What value is the top pointer initialised to in the array representation of a stack?

Back (Answer)

-1

#21
Front (Question)

Give pseudocode for the two functions which add new elements to stacks and queues

Back (Answer)

STACK push(element) top += 1 A[top] = element QUEUE enqueue(element) A[back] = element back += 1

#22
Front (Question)

Give pseudocode to push onto a stack

Back (Answer)

PROCEDURE AddToStack (item): IF top == max THEN stackFull = True ELSE top = top + 1 stack[top] = item ENDIF ENDPROCEDURE

#23
Front (Question)

Give pseudocode to pop onto a stack

Back (Answer)

PROCEDURE DeleteFromStack (item): IF top == min THEN stackEmpty = True ELSE stack[top] = item top = top - 1 ENDIF ENDPROCEDURE

#24
Front (Question)

Give pseudocode to enqueue onto a queue

Back (Answer)

PROCEDURE AddToQueue (item): IF ((front - rear) + 1) == max THEN queueFull = True ELSE rear = rear - 1 queue[rear] = item ENDIF ENDPROCEDURE