Yığın (Stack)
Son eklenen elemanın ilk çıkarıldığı LIFO yapısı.
A stack is an abstract data type that serves as a collection of elements with two principal operations: 'push' (adds an element) and 'pop' (removes the most recently added element). It is essential for managing function calls, undo mechanisms, and expression parsing.
graph LR
Center["Yığın (Stack)"]:::main
Rel_queue["queue"]:::related -.-> Center
click Rel_queue "/terms/queue"
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;
🧠 Bilgi testi
1 / 1
🧒 5 yaşındaki gibi açıkla
Bir krep yığını düşünün. En üste yeni bir krep koyarsınız ve ilk olarak en üsttekini yersiniz. Son koyduğunuz ilk yediğinizdir!
🤓 Expert Deep Dive
Yığın taşması (Stack Overflow), özyineleme sınırı aşıldığında gerçekleşir. Kuyruk çağrısı optimizasyonu yığın büyümesini engeller. Kilitlenmesiz (Lock-free) yığınlar eşzamanlılık için CAS kullanır.