Warteschlange

FIFO-Struktur, bei der das erste hinzugefügte Element zuerst entfernt wird.

A queue is an abstract data type where elements are added at the back (enqueue) and removed from the front (dequeue). It mimics real-world waiting lines and is vital for asynchronous tasks, printer spooling, and breadth-first search algorithms.

        graph LR
  Center["Warteschlange"]:::main
  Rel_stack["stack"]:::related -.-> Center
  click Rel_stack "/terms/stack"
  Rel_array["array"]:::related -.-> Center
  click Rel_array "/terms/array"
  classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
  classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
  classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
  classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
  linkStyle default stroke:#4b5563,stroke-width:2px;

      

🧠 Wissenstest

1 / 1

🧒 Erkläre es wie einem 5-Jährigen

Denk an eine Warteschlange für Eis. Die erste Person in der Reihe wird zuerst bedient, und neue Leute stellen sich hinten an. So funktioniert eine Warteschlange!

🤓 Expert Deep Dive

Lock-freie Warteschlangen (Michael-Scott) methoden. Ringpuffer sind effizient für feste Größen. Work-Stealing-Warteschlangen ermöglichen effizientes paralleles Scheduling. Prioritätswarteschlangen nutzen binäre Heaps.

📚 Quellen