Skip to content · ⁨ข้ามไปยังเนื้อหา⁩

Stacks and queues (array-backed) · ⁨Stacks และ queues (ใช้ array รองรับ)⁩

English

Two ways to hold items

  • A stack and a queue both hold a line of items, but they differ in which item comes out next.
  • A stack is LIFO: Last In, First Out — like a pile of plates.
  • A queue is FIFO: First In, First Out — like a line of people.
ไทย

วิธีสองอย่างในการจัดเก็บรายการ

  • stack และ queue ทั้งคู่จัดเก็บลำดับรายการ, แต่ต่างกันที่ รายการไหนจะถูกนำออกก่อน
  • Stack เป็น LIFO: Last In, First Out — เหมือนกองจาน
  • Queue เป็น FIFO: First In, First Out —<input排队คน

Handout · ⁨เอกสารประกอบการเรียน⁩

Log in or create account · ⁨เข้าสู่ระบบหรือสร้างบัญชี⁩

IGCSE, A-Level & AP