DSA Lab · 8 experiments
Run every structure on real heat.
Each lab experiment powers one HEATSYNC module. Pick a replay day from the May 2024 heatwave, run the operations on that day’s readings and step through every comparison, pointer move and probe, with the C program alongside.
- structures
- 8
- districts
- 36
- replay days
- 17
- lines of C
- 4,123
Replay day · feeds every experiment
26 May 2024
19 of 36 districts ≥ 40 °C · 2 in heatwave
hottest Nagpur 45.8 °C
May 2024 · bar height = districts ≥ 40 °C, colour = day’s hottest reading · ERA5 reanalysis via Open-Meteo (CC BY 4.0)
Exp 01 · Array of structures
Station Registry
AimImplement and demonstrate the use of arrays, array of structure and pointers using C.
In HEATSYNCFixed-capacity registry of the 36 district automated weather stations; insert/delete at the end, linear search by code or name.
Operations · real data
insertLast()
O(1)
deleteLast()
O(1)
search()
O(n)
struct Station registry[8]
- ▲ size = 0[0]0x6000
empty
- [1]0x6030
empty
- [2]0x6060
empty
- [3]0x6090
empty
- [4]0x60C0
empty
- [5]0x60F0
empty
- [6]0x6120
empty
- [7]0x6150
empty
®istry[i] = 0x6000 + i × 48. Insert writes registry[size] and increments size; delete clears registry[size − 1].
display() · slots[0 … size − 1]
No stations yet. Insert the hottest districts of the day.
Run an operation above. Every step it takes will replay here.
Operations log
newest firstEvery call is logged here. Select an entry to replay its steps.
Time complexity
| Operation | Cost |
|---|---|
| insertLast | O(1) |
| deleteLast | O(1) |
| search | O(n) |
| display | O(n) |