Quelpr

Other parts of this question

  1. 1(a)(i)Write code to declare the variables required for the stack.[2 marks]
  2. 1(a)(ii)Write a function to push a character, c, onto the stack, accounting for stack overflow.[4 marks]
  3. 1(a)(iii)Write a function to pop a character from the stack, accounting for stack underflow.[6 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