Quelpr

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

Questions on Data Structures, ADTs, Queues, Stacks, and Linked Lists.

Define the term abstract data type (ADT).

The mark scheme is shown once you've answered.

Practise this question

Other parts of this question

  1. 1(b)(i)Give an ADT operation that can be used to store an element in a singly linked list.[1 mark]
  2. 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]
  3. 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]
  4. 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]
  5. 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]
  6. 1(e)Explain how Stack ADT operations are implemented if a singly linked list is used.[4 marks]

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