Stack Data Structure Practice Questions

  1. Write an algorithm for Push and Pop operations on Stack using Linked list. (8)
  2. Explain the linked list implementation of stack ADT in detail?
  3. Define an efficient representation of two stacks in a given area of memory with n words and explain.
  4. Explain linear linked implementation of Stack and Queue?
    a. Write an ADT to implement stack of size N using an array. The elements in the stack are to be integers. The operations to be supported are PUSH, POP and DISPLAY. Take into account the exceptions of stack overflow and stack underflow. (8)
    b. A circular queue has a size of 5 and has 3 elements 10,20 and 40 where F=2 and R=4. After inserting 50 and 60, what is the value of F and R. Trying to insert 30 at this stage what happens? Delete 2 elements from the queue and insert 70, 80 & 90. Show the sequence of steps with necessary diagrams with the value of F & R. (8 Marks)
  5. Write the algorithm for converting infix expression to postfix (polish) expression?
  6. Explain in detail about priority queue ADT in detail?
  7. Write a function called ‘push’ that takes two parameters: an integer variable and a stack into which it would push this element and returns a 1 or a 0 to show success of addition or failure.
  8. What is a DeQueue? Explain its operation with example?
  9. Explain the array implementation of queue ADT in detail?
  10. Explain the addition and deletion operations performed on a circular queue with necessary algorithms.(8)

Leave a Reply