1. Circular queue
Data enters at the tail and leaves from the head. Both wrap around a fixed array.
Enqueue / dequeue: O(1)A SATELLITE. FOUR TYPES OF DATA. ONE DECISION.
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.
TRY IT YOURSELF
Each type gets a small waiting area.
New data joins at the back.
A bigger priority number means
the packet is more urgent.
Every packet has an ID.
Use it to find the delivery status.
They arrived in a different order. Prepare them to see why health information is chosen first.
Data enters at the tail and leaves from the head. Both wrap around a fixed array.
Enqueue / dequeue: O(1)The highest-priority packet is at the root. A parent always ranks ahead of its children.
Insert / extract: O(log n)
Peek: O(1)ID modulo bucket count chooses a bucket. IDs that collide are stored in a linked chain.
Lookup: O(1) average
O(n) worst caseThe 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.
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.
| ID | Data | Priority | Size | Attempts | Status |
|---|
The default demo uses a reliable connection so the order is easy to explain. Try a failure example to demonstrate retries. Settings lock while a pass is open.
A pass is one connection window. Sending time = size in bytes ÷ bytes per second. If the highest-priority packet cannot finish in time, it waits for the next pass. Packets have at most 3 total attempts. The 96 pending slots are bounded; records and report history use additional memory. Refreshing the page starts a fresh simulation.