Past-paper question · 2015 May-June · Paper 43 · Q5(a)

Question 5(a) 2015 · May-June · Paper 43 · 3 marks

Original past-paper question for 5(A)
Original past-paper question for 5(A)
Original past-paper question for 5(A)
Reveal official mark-scheme answer Official mark-scheme answer for 5(A)Official mark-scheme answer for 5(A)Official mark-scheme answer for 5(A)

Official answer for Question 5

Part (a)

Part (a)

✓
Top of
✓
Stack
✓
Jatinder
✓
Ben
✓
Ali
✓
0

Mark scheme 9608_s15_ms_43.pdf →

Show text version of question

Question 5

Part (a)

Question 5

A stack Abstract Data Type (ADT) has these associated operations:

  • create stack
  • add item to stack (push)
  • remove item from stack (pop)

The stack ADT is to be implemented as a linked list of nodes.

Each node consists of data and a pointer to the next node.

Part (a)

There is one pointer: the top of stack pointer, which points to the last item added to the stack.

Draw a diagram to show the final state of the stack after the following operations are carried out.

CreateStack Push("Ali") Push("Jack") Pop Push("Ben") Push("Ahmed") Pop Push("Jatinder")

Add appropriate labels to the diagram to show the final state of the stack. Use the space on the left as a workspace. Show your final answer in the node shapes on the right:

[3]

Question 11

Topic relevance

Why this question appears here

99% assigned-topic match · Data types and structures › Introduction to abstract data types

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_s15_qp_43.pdf

Keep practising this topic