Question 4(b) 2017 · May-June · Paper 43 · 5 marks
Reveal official mark-scheme answer
Official answer for Question 4
Part (b)
Question 5
Question 1
Question 1
Question 1
Question 1
Question 1
Question 1
Question 1
Question 1
Question 1
Show text version of question
Question 4
Part (b)
Question 4
An ordered linked list Abstract Data Type (ADT) has these associated operations:
- create list
- add item to list
- output list to console
The ADT is to be implemented using object-oriented programming as a linked list of nodes.
Each node consists of data and a pointer.
Part (b)
The design for the Node class consists of:
- attributes
- methods
Data : STRING Pointer : INTEGER
CreateNode(Data, Pointer) SetData(Data) SetPointer(Pointer) GetData() RETURNS STRING GetPointer() RETURNS INTEGER
The constructor method sets the attributes to the initial values that are passed as parameters.
Write program code for:
- the Node class declaration
- the constructor.
Programming language used ...................................................................................................
Program code
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[5]
Question 10
Why this question appears here
98% assigned-topic match · Further programming › Programming paradigms
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 9608_s17_qp_43.pdf
