Question 7
OCR Computer Science November 2021 Algorithms and programming (H446-02)A level9 marks
On the specification
- (a)
- 1.4 Data types, data structures and algorithms
- (b)
- 2.3 Algorithms
Question text
7 Lucas writes a program that makes use of a circular queue. The queue stores the data entered into the program. An array is used to represent the queue. (a) The program needs two pointers to access and manipulate the data in the queue. State the purpose of the two pointers and give an appropriate identifier for each. Pointer 1 purpose Pointer 1 identifier Pointer 2 purpose Pointer 2 identifier [4] (b) Lucas wants a procedure, enqueue(), that will add the parameter it is passed to the queue. Describe the steps the procedure enqueue() will follow when adding new items to the queue. [5]