A-Level Computer Science Practice: Data Structures
A-Level Computer Science Practice — Data Structures
18 MCQ practice problems on data structures. Select an answer, submit, and review the explanation.
Questions follow A-Level examination style and cover arrays, linked lists, stacks, queues, trees,
graphs, and hash tables.
Practice Questions
medium
In programming, which of the following best describes a record (also called a struct) data structure?
medium
A 2D array is declared as ARRAY[0..3][0..4] OF Integer. How many elements does this array contain?
medium
In Python, which statement correctly distinguishes a tuple from a record-like structure (such as a dataclass)?
medium
What is the key characteristic that distinguishes a linked list from an array?
medium
In a doubly linked list, each node contains pointers to both the next and previous nodes. What is the main advantage over a singly linked list?
medium
A singly linked list has n nodes. What is the time complexity of finding the middle element in (a) a standard singly linked list, and (b) a circular singly linked list with a tail pointer?
medium
Which data structure operates on a Last In, First Out
(LIFO) principle?
medium
A circular queue is implemented using an array of size 5. The front
pointer is at index 2 and the rear pointer is at index 0. After enqueuing elements A, B, C (in that
order), what are the new front and rear values?
medium
When evaluating the postfix expression "5 3 2 _ + 4 -", what is
the sequence of stack operations and the final result?
medium
Which statement correctly describes the ordering property
of a binary search tree (BST)?
medium
A BST has the following values
inserted in order: 50, 30, 70, 20, 40, 60, 80. What is the result of an in-order traversal?
medium
An AVL tree has nodes inserted
in order: 10, 20, 30. After inserting 30, the tree becomes unbalanced. What rotation is needed and
what is the resulting structure?
medium
For a directed graph with 4 vertices and 5 edges, how many
cells in the adjacency matrix will contain a non-zero value?
medium
In an unweighted graph, which algorithm guarantees finding the
shortest path between two vertices and what data structure does it use?
medium
Dijkstra's algorithm and A* both find shortest paths. Which statement correctly describes the key difference?
medium
What is the primary purpose of a hash function in a hash table?
medium
A hash table has 100 slots and contains 75 elements. What is the load factor and what does this indicate?
medium
A hash table of size 13 uses quadratic probing. A key hashes to index 5. Indices 5, 6, and 9 are occupied. At which index will the key be inserted?