The stack uses LIFO (Last In First Out) algorithm,
this means that if we push these values one by one into the stack:
1, 2, 3, 4, 5
the first value that we will get on pop will be 5, then 4, 3, 2, and only then 1.
The stack uses LIFO (Last In First Out) algorithm,this means that if we push these values one by one into the stack:1, 2, 3, 4, 5the first value that we will get on pop will be 5, then 4, 3, 2, and only then 1.
การแปล กรุณารอสักครู่..

สแต็คใช้ LIFO (ล่าสุดในออกก่อน)
ขั้นตอนวิธีนี้หมายความว่าถ้าเราผลักดันค่าเหล่านี้หนึ่งโดยหนึ่งลงไปในกอง:
1, 2, 3, 4, 5
ค่าแรกว่าเราจะได้รับในป๊อปจะเป็น 5 แล้ว 4, 3, 2, และเพียงแล้ว 1
การแปล กรุณารอสักครู่..

สแต็คที่ใช้เข้า ( สุดท้าย ออกก่อน ) ขั้นตอนวิธี
ซึ่งหมายความ ว่า ถ้าเราใส่ค่าเหล่านี้หนึ่งโดยหนึ่งในกอง :
1 , 2 , 3 , 4 , 5
1 ค่า ที่เราจะได้รับใน pop จะเป็น 5 , 4 , 3 , 2 , 1 และเพียง 1
การแปล กรุณารอสักครู่..
