Structures for Computer Sciences
Fundamental data structures are the standard ways of organising data in memory so that operations stay efficient: arrays, linked lists, stacks, queues, hash tables, trees and graphs. Each offers different costs for insert, delete and lookup. Knowing those trade-offs is the main skill this unit trains, since nearly every program depends on them.
Stage: Data Structures and Algorithms · Part of the Computer Science roadmap · Last reviewed 19 November 2026
What to learn in Structures
- Implement a stack and a queue and explain their last-in and first-in behaviour
- Compare array and linked list costs for insertion, deletion and indexing
- Explain how a hash table handles collisions through chaining or probing
- Build a binary search tree and explain why balance matters
- Represent a graph using an adjacency list and an adjacency matrix
Structures interview questions
When would you use a linked list instead of an array?
Use a linked list when you often insert or remove elements at known positions, especially the front, and do not need random access. Arrays give constant-time indexing and better cache locality, so they are the default choice unless frequent mid-sequence changes dominate.
How does a hash table achieve average constant-time lookup?
A hash function maps a key to a bucket index, so the item can be found directly instead of searching. Collisions are handled by chaining or probing, and the table resizes as it fills to keep chains short, which keeps the average cost near constant.
Where Structures fits in the Computer Science roadmap
Structures belongs to the Data Structures and Algorithms stage (beginner level). The toolkit.
Other units in this stage
Back to the full Computer Science roadmap