Skip to main content
A-LevelComputer ScienceProgramming9618/32 · Oct/Nov 2021 · Q1013 Marks

State three essential features of recursion.

  1. (a)State three essential features of recursion.[3]
  2. (b)Explain the reasons why a stack is a suitable Abstract Data Type (ADT) to implement recursion.[3]
  3. (c)Identify two ADTs other than a stack.[2]
  4. (d)The function StackFull () checks whether a stack is full. The function uses the variable TopOfStack to represent the pointer to the most recent position used on the stack, and the variable Max to represent the maximum size of the stack. Assume TopOfStack and Max are global variables. FUNCTION StackFull() RETURNS BOOLEAN IF TopOfStack = Max THEN RETURN TRUE ELSE RETURN FALSE ENDIF ENDFUNCTION An algorithm AddInteger is required to add a new integer data element to a stack. The stack is implemented as an array ArrayStack. The function AddInteger() calls StackFull() and returns an appropriate message. Complete the pseudocode for the function AddInteger(). FUNCTION AddInteger(NewInteger : INTEGER) RETURNS STRING[5]

Mark scheme

Marking points from the official mark scheme (Oct/Nov 2021). The mark or mark type is shown in brackets.

  1. [1] Must have a base case/stopping condition
  2. [1] Must have a general case
  3. [1] ... which calls itself (recursively) // Defined in terms of itself
  4. [1] ... which changes its state and moves towards the base case
  5. [1] Unwinding can occur once the base case is reached.
  6. [1] A stack is a LIFO data structure
  7. [1] Each recursive call is pushed onto the stack
  8. [1] ... and is then popped as the function ends
  9. [1] Enables backtracking/unwinding
  10. [1] to maintain the required order.
  11. [1] Linked List
  12. [1] Queue
  13. [1] Binary Tree
  14. [1] Checking if stack is full / empty using IF ... THEN ... (ELSE) ... ENDIF
  15. [1] correctly using StackFull() function
  16. [1] RETURN suitable message if stack is full
  17. [1] RETURN message if space available on stack
  18. [1] Incrementing TopOfStack pointer if space available
  19. [1] Assigning new data using correct NewInteger variable
  20. [1] to correct the array element in ArrayStack [] array.

Write your answer and get it marked

On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.

Sign up free →

About this question

Topic
Programming, A-Level Computer Science (syllabus 9618). Structured question, 13 marks.
Source
A-Level Computer Science, Oct/Nov 2021 Paper 3 Variant 2, question 10.

Questions and mark schemes are from past examination papers and remain the copyright of the exam board. How Oracle Prep builds its content

Related Computer Science questions

© 2026 Oracle Prep