Skip to content
Android waitlistTry on iPad
Get started

Algorithms: CAIE A‑Level Computer Science questions

Every CAIE A-Level Computer Science exam question on 19.1 Algorithms, June 2024 and the specimen papers, with its mark scheme and examiner’s report.

Paper
All papers
Exam
All years
Calculations

198 questions

  1. Q10(a)

    June 2024 · Paper 3

    The whole paper ↗
  2. Q10(b)

    June 2024 · Paper 3

    The whole paper ↗
  3. Q10(c)

    June 2024 · Paper 3

    The whole paper ↗
  4. Q1(d)(i)

    June 2024 · Paper 4

    The whole paper ↗The code files (zip) ↓
    The start of question 1
  5. Q1(d)(ii)

    June 2024 · Paper 4

    The whole paper ↗The code files (zip) ↓
    The start of question 1
  6. Q1(d)(iii)

    June 2024 · Paper 4

    The whole paper ↗The code files (zip) ↓
    The start of question 1
  7. Q1(e)(i)

    June 2024 · Paper 4

    The whole paper ↗The code files (zip) ↓
    The start of question 1
  8. Q1(e)(ii)

    June 2024 · Paper 4

    The whole paper ↗The code files (zip) ↓
    The start of question 1
  9. Q1(e)(iii)

    June 2024 · Paper 4

    The whole paper ↗The code files (zip) ↓
    The start of question 1
  10. Q3(a)

    June 2024 · Paper 4

    The whole paper ↗The code files (zip) ↓
    The start of question 3
  11. Q3(b)

    June 2024 · Paper 4

    The whole paper ↗The code files (zip) ↓
    The start of question 3
  12. Q3(c)

    June 2024 · Paper 4

    The whole paper ↗The code files (zip) ↓
    The start of question 3
  13. Q3(d)(i)

    June 2024 · Paper 4

    The whole paper ↗The code files (zip) ↓
    The start of question 3
  14. Q3(d)(ii)

    June 2024 · Paper 4

    The whole paper ↗The code files (zip) ↓
    The start of question 3
  15. Q3(d)(iii)

    June 2024 · Paper 4

    The whole paper ↗The code files (zip) ↓
    The start of question 3
  16. Q7(a)

    Specimen · Paper 3

    The whole paper ↗
    The start of question 7
  17. Q7(b)

    Specimen · Paper 3

    The whole paper ↗
    The start of question 7
  18. Q1(b)

    Specimen · Paper 4

    The whole paper ↗The code files (zip) ↓
    The start of question 1
  19. Q1(d)(ii)

    Specimen · Paper 4

    The whole paper ↗The code files (zip) ↓
    The start of question 1
  20. Q1(e)(i)

    Specimen · Paper 4

    The whole paper ↗The code files (zip) ↓
    The start of question 1
All 26 questions on Algorithms, as a list
  1. June 2024, Paper 3, Q10(a) (1 mark): State a condition that must be true for an array to be searchable for a binary search. [1]
  2. June 2024, Paper 3, Q10(b) (5 marks): Complete the given pseudocode to find an item in a 1D array Names of type STRING using a binary search. DECLARE Names : ARRAY[1:100000] OF STRING DECLARE TopOfL
  3. June 2024, Paper 3, Q10(c) (2 marks): Describe the performance of a binary search in relation to the number of data items in the array being searched. Refer to Big O notation in your answer. [2]
  4. June 2024, Paper 4, Q1(d)(i) (4 marks): Write program code for BubbleSort(). Save your program. Copy and paste the program code into part 1(d)(i) in the evidence document. [4]
  5. June 2024, Paper 4, Q1(d)(ii) (1 mark): Write program code to amend the main program to call BubbleSort() and then output the contents of DataStored. Save your program. Copy and paste the program code
  6. June 2024, Paper 4, Q1(d)(iii) (1 mark): Test your program by inputting the following data in the order given: 5 3 9 4 1 2 Take a screenshot of the output(s). Save your program. Copy and paste the scre
  7. June 2024, Paper 4, Q1(e)(i) (6 marks): Write program code for the iterative function BinarySearch(). Save your program. Copy and paste the program code into part 1(e)(i) in the evidence document. [6]
  8. June 2024, Paper 4, Q1(e)(ii) (3 marks): Write program code to amend the main program to: • take a number as input from the user • call BinarySearch() with the number input • output the value returned
  9. June 2024, Paper 4, Q1(e)(iii) (2 marks): Test your program twice with the following inputs: Test 1: 5 1 6 2 8 10 2 Test 2: 5 1 6 2 8 10 7 Take a screenshot of the output(s). Save your program. Copy and
  10. June 2024, Paper 4, Q3(a) (1 mark): The main program initialises all the elements in QueueData to a suitable null value, QueueHead to −1 and QueueTail to −1. Write program code for the main progra
  11. June 2024, Paper 4, Q3(b) (4 marks): The function Enqueue() takes the data to insert into the queue as a parameter. If the queue is not full, it inserts the parameter in the queue, updates the appr
  12. June 2024, Paper 4, Q3(c) (3 marks): The function Dequeue() returns "false" if the queue is empty. If the queue is not empty, it returns the next item in the queue and updates the appropriate point
  13. June 2024, Paper 4, Q3(d)(i) (6 marks): The string values to be stored in the queue are 7 characters long. The first 6 characters are digits and the 7th character is a check digit. The check digit is
  14. June 2024, Paper 4, Q3(d)(ii) (1 mark): Write program code to amend the main program to: • call StoreItems() • call Dequeue() • output a suitable message if the queue was empty • output the returned v
  15. June 2024, Paper 4, Q3(d)(iii) (2 marks): Test the program with the following inputs in the order given: 999999X 1251484 5500212 0033585 9845788 6666666 3258746 8111022 7568557 0012353 Take a screenshot
  16. Specimen, Paper 3, Q7(a) (8 marks): An ordered binary tree Abstract Data Type (ADT) has these associated operations: • create tree • add new item to tree • traverse tree A student is designing a p
  17. Specimen, Paper 3, Q7(b) (5 marks): An ordered binary tree Abstract Data Type (ADT) has these associated operations: • create tree • add new item to tree • traverse tree A student is designing a p
  18. Specimen, Paper 4, Q1(b) (7 marks): Pseudocode for an insertion sort is shown below with three pieces of code missing. PROCEDURE InsertionSort(TheData[]:INTEGER) FOR Count ← FirstElement TO DataTo
  19. Specimen, Paper 4, Q1(d)(ii) (2 marks): Test your program and take a screenshot to show the result. Save your program. Copy and paste the screenshot into part 1(d)(ii) in the evidence document. [2]
  20. Specimen, Paper 4, Q1(e)(i) (6 marks): Write a function that: • takes a whole number as input from the user • if the number is in TheData outputs ‘found’ and returns true • if the number is not in Th
  21. Specimen, Paper 4, Q1(e)(ii) (2 marks): Test the function using the number 8 as input, then the number 9 as input. Take a screenshot of the results of each test, making sure the input is visible in th
  22. Specimen, Paper 4, Q3(a) (3 marks): Write a program that defines QueueData and its pointers. Save your program as program 3. Copy and paste the program code into part 3(a) in the evidence document
  23. Specimen, Paper 4, Q3(b) (6 marks): Write program code for a function, Enqueue. The function should take an item to be added to the queue as a parameter: • if the element was successfully added to
  24. Specimen, Paper 4, Q3(c) (8 marks): Write program code for a function, ReadFile, which: • asks the user to input a filename • reads the data from the text file into QueueData. The function returns
  25. Specimen, Paper 4, Q3(d)(ii) (3 marks): You have two text files DataToAdd.txt and SecondData.txt. Use the filenames below as input to test your program: • DataToAdd.txt • SecondData.txt • ThirdData.tx
  26. Specimen, Paper 4, Q3(e) (5 marks): The function, Remove: • removes the first two elements from the queue • concatenates the elements with a space in between them. For example, if the first item

Questions, mark schemes and examiner’s reports are © Cambridge University Press & Assessment, from their published past papers. Plumi isn’t affiliated with any exam board. Want whole papers? Full past papers.

Rather write your answers by hand on iPad? Plumi marks them against the same mark schemes.