ExamBank Scot · AH Computing Science question bank · All AH Computing Science questions
2 marks · Linked lists
An online version of a board game is being developed where the wording in each square on the game board is stored as a node in a linked list. The layout of the game board is shown below. Move Move Move forward back forward Start 2 steps 2 steps 3 steps Move back 2 steps Move Move Move Move back back forward forward 2 steps 3 steps 2 steps 3 steps Move forward 2 steps Move Move Move Move back forward back forward Finish 1 step 3 steps 2 steps 2 steps State the type of linked list that should be used. Justify your answer.
• a double linked list should be used • when a player lands on a move backwards square, they would need to traverse backwards in the linked list to the correct square; similarly, when they land on a move forward square, they need to traverse forward in the linked list Award 1 mark for double linked list. Award 1 mark for justification. Accept doubly linked list.