Programming · DSA Glossary
Data Structures Glossary: Key Terms Explained
Quick summary — data structures glossary
This data structures glossary explains the core terms in four groups: linear structures (array, linked list, stack, queue), hashing (hash function, hash table, collision), non-linear structures (tree, binary search tree, heap, graph, traversal) and complexity (Big-O, time and space complexity). Knowing these terms makes DSA lessons and interview questions much easier to follow.
In this guide you will learn:
- Linear structure terms — arrays, lists, stacks and queues.
- Hashing terms — how fast lookup works.
- Trees and graphs — nodes, edges and traversal.
- Complexity terms — Big-O explained simply.
- Revision templates — flashcards and a practice list.
SECTION 01Linear data structure terms
Linear structures store items one after another. They are the first structures every beginner learns, and they appear in almost every program. They also appear constantly in interview questions, usually as the first step of a bigger problem.
| Term | Simple meaning | Python example | Remember it as |
|---|---|---|---|
| Array / list | Items stored in order, accessed by index | marks = [72, 85, 90]; marks[1] | Numbered lockers |
| Linked list | Nodes where each points to the next | node.next = other_node | A treasure hunt of clues |
| Stack | Last in, first out (LIFO) | stack.append(x); stack.pop() | A pile of plates |
| Queue | First in, first out (FIFO) | deque.append(x); deque.popleft() | A ticket counter line |
marks = [72, 85, 90, 64]
print(marks[0]) # 72 (index starts at 0)
print(marks[-1]) # 64 (last item)
print(marks[1:3]) # [85, 90] (slice)
stack = []
stack.append("page1"); stack.append("page2")
print(stack.pop()) # page2 — last in, first out
class Node:
def __init__(self, value):
self.value = value
self.next = None
a, b, c = Node("A"), Node("B"), Node("C")
a.next, b.next = b, c
node = a
while node:
print(node.value, end=" -> ")
node = node.next
print("None") # A -> B -> C -> None
SECTION 02Hashing terms
Hashing is the idea behind Python dictionaries and sets. It explains why looking up a key is usually fast, even in very large collections.
| Term | Simple meaning | Example | Why it matters |
|---|---|---|---|
| Hash function | Turns a key into a number used to find a slot | hash("apple") | Decides where data is stored |
| Hash table | Storage that uses hashes to place and find items | Python dict and set | Fast average lookup |
| Collision | Two keys map to the same slot | Handled internally by the table | Explains worst-case slowdowns |
| Key and value | The label and the data stored under it | {"roll_42": "Asha"} | Basis of dictionaries |
students = {"roll_42": "Asha", "roll_17": "Ravi"}
print(students["roll_42"]) # Asha
print("roll_99" in students) # False — fast membership check
students["roll_99"] = "Meera" # insert
print(len(students)) # 3
# Sets also use hashing
seen = {"apple", "banana"}
print("apple" in seen) # True
ok = {(1, 2): "tuple key works"}
print(ok[(1, 2)])
try:
bad = {[1, 2]: "list key"}
except TypeError as e:
print("Error:", e) # unhashable type: 'list'
# Keys must be hashable (usually immutable) so their hash never changes
SECTION 03Trees, graphs and complexity terms
Non-linear structures connect items in branches or networks. Complexity terms describe how the cost of operations grows as data grows — the language interviewers use to compare solutions.
| Term | Simple meaning | Example | Remember it as |
|---|---|---|---|
| Node, edge | An item and a connection between items | Cities and roads | Dots and lines |
| Binary search tree (BST) | Each node: smaller values left, larger right | Fast sorted lookups if balanced | A sorted family tree |
| Heap | Tree where the parent is always smaller (min-heap) or larger | Priority queues | The boss always on top |
| Big-O notation | How time or memory grows with input size n | O(1), O(log n), O(n), O(n²) | Growth speed, not exact time |
tree = {"A": ["B", "C"], "B": ["D", "E"], "C": [], "D": [], "E": []}
def dfs(node): # depth-first: go deep first
print(node, end=" ")
for child in tree[node]:
dfs(child)
from collections import deque
def bfs(start): # breadth-first: level by level
q = deque([start])
while q:
n = q.popleft()
print(n, end=" ")
q.extend(tree[n])
dfs("A"); print() # A B D E C
bfs("A"); print() # A B C D E
Big-O cheat sheet (n = number of items)
O(1) constant dict lookup, list index
O(log n) logarithmic binary search, balanced tree lookup
O(n) linear scanning a list once
O(n log n) linearithmic efficient sorting
O(n²) quadratic nested loops over the same list
For n = 1,000,000: O(log n) ≈ 20 steps, O(n) = 1,000,000 steps.
SECTION 04Glossary revision templates
Use these templates to revise the vocabulary quickly before exams or interviews.
Front | Back
Stack | LIFO — last in, first out
Queue | FIFO — first in, first out
Hash collision | two keys map to the same slot
BST property | left < node < right
Min-heap | parent ≤ children; smallest on top
BFS | visit level by level (uses a queue)
DFS | go deep first (uses recursion/stack)
O(log n) | halves the problem each step
One practice problem per term
Array → reverse a list in place
Stack → check balanced brackets
Queue → simulate a ticket line
Hash map → count word frequencies
BST → check if a value exists
Heap → find the 3 largest numbers
Graph → BFS shortest path in a grid
Big-O → state the complexity of each solution
Explain each term in one sentence and one real example
Term: ______
Meaning: ______________
Real example: ______________
Python tool: ______________
Complexity of main operation: ______
SECTION 05Tips for learning DSA vocabulary
These habits make the terms stick:
- Pair every term with an image — plates for stacks, a queue line for queues.
- Code a tiny example — five lines of Python fix a term in memory.
- Say the complexity aloud — practise stating Big-O after each solution.
- Group related terms — linear, hashing, trees and graphs, complexity.
- Revise with flashcards — short daily reviews beat long cramming.
SECTION 06Interview Q&A — data structures terms
Q1What is the difference between a stack and a queue?
A stack removes the most recently added item first (LIFO); a queue removes the oldest item first (FIFO).
Q2What is a hash collision?
When two different keys produce the same slot in a hash table. Tables handle it with techniques like chaining or probing.
Q3What is a binary search tree?
A binary tree where each node's left subtree has smaller values and the right subtree has larger values, enabling fast search when balanced.
Q4What does O(log n) mean?
The work grows very slowly as input grows, typically because each step halves the remaining problem, as in binary search.
Q5What is the difference between BFS and DFS traversal?
BFS visits nodes level by level using a queue; DFS goes as deep as possible along a branch before backtracking, using recursion or a stack.
SECTION 07Test yourself — data structures terms quiz
Five questions. No sign-up.
0 / 5Pick an answer to see why it is right or wrong.
SECTION 08Frequently asked questions
What are the basic data structures every beginner should know?
Arrays or lists, linked lists, stacks, queues, hash tables, trees, heaps and graphs.
What is Big-O notation in simple words?
A way to describe how the time or memory an algorithm needs grows as the input size grows.
What is the difference between linear and non-linear data structures?
Linear structures store items in a sequence, like arrays and queues; non-linear ones branch or connect, like trees and graphs.
Is a Python list an array?
A Python list is a dynamic array of references, so it behaves like an array with fast index access and resizing.
How can I remember DSA terms easily?
Link each term to a real-world picture, code a tiny example and revise with flashcards regularly.
SECTION 09Related reads
Classroom & online · Noida
Master DSA with Python
Our Python Training Course covers core Python, data structures and problem-solving practice to prepare you for coding interviews.
Talk to a counsellor for current fees- Python and data structures
- Problem-solving practice
- Mock interviews
- Weekday & weekend batches