Back to the full dot-point answer
WalesComputer ScienceQuick questions
Unit 3 Programming and System Development
Quick questions on Advanced data structures and algorithms: linked lists, tree traversals and recursion - WJEC A-Level Computer Science
4short Q&A pairs drawn directly from our worked dot-point answer. For full context and worked exam questions, read the parent dot-point page.
What are binary tree traversals?Show answer
The choice of traversal matters: in-order gives sorted output, pre-order is used to copy a tree or produce prefix expressions, and post-order is used to delete a tree safely or evaluate postfix expressions.
What are recursion on structures?Show answer
Recursion is the natural way to process trees and linked lists: the structure is defined in terms of smaller versions of itself (a tree is a node with two subtrees), so the algorithm mirrors that definition with a base case (an empty subtree or null pointer) and a recursive case.
What is q1?Show answer
State which tree traversal outputs the values of a binary search tree in ascending order. [1 mark]
What is q2?Show answer
State one advantage of a linked list over an array. [1 mark]
Have a question we have not covered?
This dot-point answer is short enough that we have not extracted many short questions yet. Read the full dot-point answer or ask Mo, our study assistant, in the chat for follow ups.