March 1, 2012

Stack

Stack

  1. A limitation; we have to access the last stack element first from stack (LIFO).
  2. IsEmpty() used to check either stack is emptied while using pop() or we use exception to handle this situation.
  3. If we want to use array inside, we have to shift the elements left to access/insert/delete a specific element in stack.
  4. As array is of fixed size so program can be crashed when array is full. So we use IsFull() function to check it before push().
  5. We use top() to get the most recent element in stack.
Last updated: March 19, 2014