3 marksAbstract Data Types (ADTs)
CAPE Computer Science Unit 2 · 2016 · Paper 2 · Question 1(b)
Write code to implement the function `public void insertToFront(String s)` which accepts a string `s`, stores it in a new node, and inserts it at the front of an existing linked list where `top` points to the first node.
The mark scheme is shown once you've answered.
Practise this question