Applications of stacks (expression evaluation, recursion) MCQsBy: Prof. Dr. Fazal Rehman | Last updated: May 14, 2025 20 Score: 0 Attempted: 0/20 Subscribe 1. : In which of the following applications is a stack commonly used? (A) Sorting (B) Searching (C) Expression evaluation (D) Hashing 2. : Which data structure is often used for implementing the undo feature in text editors? (A) Queue (B) Stack (C) Linked list (D) Tree 3. : What is the primary advantage of using a stack in expression evaluation? (A) Allows random access to elements (B) Simplifies complex arithmetic operations (C) Facilitates tracing program execution (D) Handles function calls efficiently 4. : Which of the following is NOT a valid application of a stack? (A) Function call management (B) Backtracking in algorithms (C) Arithmetic expression parsing (D) Binary search tree traversal 5. : What is the role of a stack in evaluating postfix expressions? (A) Stores operands (B) Stores operators (C) Stores both operands and operators (D) Manages parentheses 6. : Which of the following expressions is equivalent to the postfix expression “3 4 + 5”? (A) (3 + 4) * 5 (B) 3 + (4 * 5) (C) 3 + 4 * 5 (D) (3 * 4) + 5 7. : In expression evaluation using a stack, what is done when encountering an operand? (A) Push it onto the stack (B) Pop it from the stack (C) Ignore it (D) Perform arithmetic operations 8. : What is the primary purpose of using a stack in recursion? (A) To store local variables (B) To manage function calls and return addresses (C) To optimize memory usage (D) To prevent stack overflow errors 9. : Which of the following describes the behavior of a stack during recursion? (A) Each recursive call creates a new stack frame (B) Each recursive call shares the same stack frame (C) Recursion does not use a stack (D) Stack frames are created only for base cases 10. : What is tail recursion? (A) A recursion where recursive call is not the last operation (B) A recursion where recursive call is the last operation (C) A recursion that doesn’t involve function calls (D) A recursion that involves nested functions 11. : Which of the following statements about postfix expressions is true? (A) They are easier to read than infix expressions (B) They are evaluated from left to right (C) They require parentheses to specify order of operations (D) They are converted to infix using stacks 12. : What is the time complexity of evaluating an arithmetic expression using a stack-based approach? (A) O(1) (B) O(n) (C) O(log n) (D) O(n^2) 13. : Which of the following operations is NOT typically performed using a stack in algorithm design? (A) Depth-first search traversal (B) Topological sorting (C) Breadth-first search traversal (D) Shortest path calculation 14. : In an infix expression, how are parentheses handled during evaluation using a stack? (A) They are ignored (B) They are evaluated first (C) They are removed from the expression (D) They determine the order of operations 15. : Which data structure is typically used to implement a stack in programming languages? (A) Array (B) Linked list (C) Tree (D) Graph 16. : What is the main advantage of using postfix notation in expressions? (A) It eliminates the need for parentheses (B) It allows for easier debugging (C) It reduces the number of operands (D) It speeds up evaluation time 17. : Which of the following is a valid postfix notation for the infix expression “a + b * c”? (A) a b + c * (B) a b c * + (C) a b c + * (D) a * b + c 18. : What is the key advantage of using postfix notation for arithmetic expressions? (A) Easier conversion to prefix notation (B) Better handling of operator precedence (C) Reduced memory usage (D) Faster execution time 19. : In recursion, what is the base case? (A) The case where the recursion is infinite (B) The starting point of recursion (C) The case that terminates the recursion (D) The last step of recursion 20. : Which of the following is NOT a limitation of using recursion? (A) Limited stack size (B) Difficulty in understanding and debugging (C) Slower execution compared to iterative methods (D) Difficulty in handling complex algorithms Data Structures MCQs Basic Concepts Introduction to Data Structures Abstract Data Types (ADT) MCQs Complexity Analysis MCQs Time complexity MCQs Space complexity MCQs Big O, Big Ω, Big Θ notations MCQs Linear Data Structures MCQs Arrays MCQs One-dimensional arrays MCQs Multi-dimensional arrays MCQs Operations: traversal, insertion, deletion MCQs Linked Lists MCQs Singly linked list MCQs Doubly linked list MCQs Circular linked list MCQs Stacks MCQs Stack operations (push, pop, peek) MCQs Applications of stacks (expression evaluation, recursion) MCQs Queues MCQs Queue operations (enqueue, dequeue, front, rear) MCQs Types: Simple queue, circular queue, priority queue, deque MCQs Non-Linear Data Structures MCQs Trees MCQs Binary trees MCQs Binary Search Trees (BST) MCQs AVL Trees MCQs B-trees and B+ trees MCQs Tree traversal methods (in-order, pre-order, post-order) MCQs Heaps MCQs Min-heap MCQs Max-heap MCQs Heap operations (insertion, deletion, heapify) MCQs Applications of heaps (priority queues, heap sort) MCQs Graphs MCQs Graph representation (adjacency matrix, adjacency list) MCQs Graph traversal algorithms (DFS, BFS) MCQs Shortest path algorithms (Dijkstra’s, Bellman-Ford) MCQs Minimum Spanning Tree (Kruskal’s, Prim’s) MCQs Hashing MCQs MCQs Hash Tables Hash functions MCQs Collision resolution techniques (chaining, open addressing) MCQs Applications of hashing MCQs Sorting and Searching Algorithms MCQs Sorting Algorithms MCQs Bubble sort MCQs Selection sort MCQs Insertion sort MCQs Merge sort MCQs Quick sort MCQs Heap sort MCQs Searching Algorithms MCQs Linear search MCQs Binary search MCQs Interpolation search MCQs Miscellaneous Memory Management in data structures MCQs Dynamic memory allocation MCQs Garbage collection MCQs String Manipulation Algorithms MCQs Pattern matching (KMP, Rabin-Karp) MCQs String hashing MCQs Data Structures MCQs 1 Data Structures MCQs 2 Data Structures MCQs 3 Data Structures MCQs 4 Data Structures MCQs 5 Stacks Solved MCQs Queues MCQs pointer mcqs Array MCQs Related Posts:Program to evaluate an expression using stacks in Data Structures (C plus plus)Write a C++ Program To Find The Factorial Of A Number By Using The Recursion.Eliminating Left Recursion from a GrammarPost-project evaluation and lessons learned MCQs - Software Project ManagementMonitoring and evaluation of restoration projects MCQsMeasurement and Evaluation in Physical Education MCQs