Stacks and Queues

Download Q&A
Q. In a stack, what happens when you try to pop an element from an empty stack?
  • A. Returns null
  • B. Throws an exception
  • C. Returns 0
  • D. Does nothing
Q. What is the time complexity of popping an element from a queue implemented using a linked list?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Q. Which data structure would you use to implement a function call stack?
  • A. Queue
  • B. Array
  • C. Stack
  • D. Linked List
Q. Which of the following data structures uses LIFO (Last In First Out) principle?
  • A. Queue
  • B. Stack
  • C. Array
  • D. Linked List
Q. Which of the following is a valid operation for a stack?
  • A. Enqueue
  • B. Dequeue
  • C. Push
  • D. Insert
Q. Which operation is not allowed in a stack?
  • A. Push
  • B. Pop
  • C. Peek
  • D. Dequeue
Showing 1 to 6 of 6 (1 Pages)
Soulshift Feedback ×

On a scale of 0–10, how likely are you to recommend The Soulshift Academy?

Not likely Very likely