Data Structure Interview Questions (cont.)
Stack data structure is used in recursion due to its last in first out nature. Operating system maintains the stack in order to save the iteration variables at each function call
Stack is an ordered list in which, insertion and deletion can be performed only at one end that is called the top. It is a recursive data structure having pointer to its top element. The stack is sometimes called as Last-In-First-Out (LIFO) list i.e. the element which is inserted first in the stack will be deleted last from the stack.
Overflow occurs when top = Maxsize -1
Người sưu tầm: Nguyễn Thị Bảo Trang
» Tin mới nhất:
» Các tin khác: