Quelpr

CAPE Computer Science Unit 2 · 2010 · Paper 2 · Question 1(e)

Explain how Stack ADT operations are implemented if a singly linked list is used.

The mark scheme is shown once you've answered.

Practise this question

Other parts of this question

  1. 1(a)Define the term abstract data type (ADT).[2 marks]
  2. 1(b)(i)Give an ADT operation that can be used to store an element in a singly linked list.[1 mark]
  3. 1(b)(ii)A singly linked list is created and elements 25, 50, 75 are placed in that order. Draw the list after all three elements have been placed using the operation…[3 marks]
  4. 1(c)(i)The Queue ADT provides enqueue(Queue, data) and dequeue(Queue) operations. Suppose a Queue must be implemented for storing integers. Describe the computer…[4 marks]
  5. 1(c)(ii)Write C code for a function that implements enqueue(Queue, data) assuming data is an integer, handling queue overflow conditions.[5 marks]
  6. 1(d)Given a queue q with elements, and stack stk with operations pop, push, and isEmpty, write an algorithm to reverse the order of all elements in q using only…[6 marks]

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