Quelpr

CAPE Computer Science Unit 2 · 2013 · Paper 2 · Question 1(a)(i)

A stack is needed to store characters. Assume stack capacity is 1000 characters.

Write code to declare the variables required for the stack.

The mark scheme is shown once you've answered.

Practise this question

Other parts of this question

  1. 1(a)(ii)Write a function to push a character, c, onto the stack, accounting for stack overflow.[4 marks]
  2. 1(a)(iii)Write a function to pop a character from the stack, accounting for stack underflow.[6 marks]
  3. 1(b)(i)Explain what a 'linked list' is using a labelled diagram.[7 marks]
  4. 1(b)(ii)a)With the aid of a diagram, explain how a new node can be inserted at the top of the linked list.[3 marks]
  5. 1(b)(ii)b)With the aid of a diagram, explain how a new node can be inserted at the bottom of the linked list.[3 marks]

More practice: the rest of this paper · more Abstract Data Types (ADTs) questions · all CAPE Computer Science Unit 2 past papers