112
Dispatching 112
How Data Structures Save Lives
Mohamed Osama — 314CD — SDA • Tema 1
Every Second Counts
In emergency centers, we deal with human lives.
Paper-based tracking
A nightmare under pressure — slow, error-prone, unscalable.
Naive data storage
Breaks down when sorting and prioritization matter.
No time to sort
The system must decide instantly — not the operator.
The Building Blocks
Units
Static Array
Incidents
Circular Doubly Linked List
Priority Queues
FIFO
Dispatch Stack
LIFO
🔑Queues and stack store pointers, not data. One source of truth.
Results
All tests passed. All requirements met.
✓
0
Operations
Implemented & tested
✓
0
Memory Leaks
Valgrind clean — 20pt
✓
1→5
Generic Structure
void* queue, 5 uses
✓
0
Special Cases
Sentinel pattern
What I Built, What I Learned
LIFO vs FIFO — when each behavior matters
Stack & Queue — same blocks, different rules
Pointers — from scary to natural
void* casting — one structure, many shapes
"The right data structure doesn't just store data — it makes the right decisions easier to write."
What's Next
Three directions to extend the system
Smart Matching
Match unit type with incident type.
type matching
Faster Lookups
Hash tables: O(n) → O(1).
O(1)
Dashboard
Live map for dispatchers.
real-time
The data structures are in place. Make them visible — and intelligent.