A SATELLITE. FOUR TYPES OF DATA. ONE DECISION.

What should we
send to Earth first?

A satellite has limited time to send data to Earth.
A packet is a small piece of data. Let’s choose which one goes first.

6 steps · about 1 minute
◇
SATELLITEEARTH
Send important data first

TRY IT YOURSELF

Follow a packet’s journey.

Simulated time 0s
1

Store the data

Circular queue
→

Each type gets a small waiting area.
New data joins at the back.

8 spaces per type. A full queue drops its oldest packet.
Remember: the queue stores.
2

Choose what goes next

Priority queue · max-heap
→

A bigger priority number means
the packet is more urgent.

Remember: the heap chooses.
3

Track the delivery

Hash table

Every packet has an ID.
Use it to find the delivery status.

0Delivered
4Waiting
0Dropped
Try an ID to see its status.
Remember: the hash table tracks.
i
Four sample packets are ready.

They arrived in a different order. Prepare them to see why health information is chosen first.

Explore the data structuresHeap diagram, packet records, settings and reports
+

1. Circular queue

Data enters at the tail and leaves from the head. Both wrap around a fixed array.

Enqueue / dequeue: O(1)

2. Max-heap

The highest-priority packet is at the root. A parent always ranks ahead of its children.

Insert / extract: O(log n)
Peek: O(1)

3. Hash table

ID modulo bucket count chooses a bucket. IDs that collide are stored in a linked chain.

Lookup: O(1) average
O(n) worst case

The diagrams show the real structures in this simulation. The heap tree shows up to 7 nodes. Priorities are refreshed every 10 simulated seconds during a pass, and at pass boundaries or explicit time advances.

Priority rules

Health / TT&C: 90 · Image / SSTV: 60 · Voice A / M17: 40 · Voice B / Codec2: 30

Effective priority = base + min(100, floor(scheduler waiting time / 10)). Older creation time breaks ties. Aging refresh and heap rebuild take O(n); capped aging reduces starvation risk but cannot guarantee delivery under unlimited load.