Recursion relies on the stack's _______ behavior to manage function calls and their respective _______.

  • FIFO (First-In-First-Out)
  • LIFO (Last-In-First-Out)
  • Priority
  • Random
Recursion relies on the stack's LIFO (Last-In-First-Out) behavior. When a function calls itself, each subsequent call is placed on the stack, and the last-called function is processed first, managing the flow of recursive calls.

Exception handling is crucial in stack operations to manage _______ scenarios.

  • Predictable
  • Rare
  • Regular
  • Unexpected
Exception handling is crucial in stack operations to manage unexpected scenarios. This includes situations where the stack is full, empty, or encounters an error during push or pop operations. Proper exception handling enhances the robustness and reliability of programs using stacks.

Binary search operates by repeatedly dividing the _______ in half until the desired element is found or determined to be absent.

  • Array
  • List
  • Sorted array
  • Unsorted array
Binary search operates by repeatedly dividing the sorted array in half until the desired element is found or determined to be absent. The array must be sorted for binary search to work correctly.

Which of the following sorting algorithms is similar to bubble sort in terms of repeatedly comparing adjacent elements and swapping if they are in the wrong order?

  • Insertion Sort
  • Merge Sort
  • Quick Sort
  • Selection Sort
Insertion sort is similar to bubble sort as it repeatedly compares adjacent elements and swaps them if they are in the wrong order, just like bubble sort.

Queues are commonly used in _______ systems to manage tasks and processes.

  • Batch processing
  • Multi-core
  • Real-time
  • Single-threaded
Queues are frequently employed in real-time systems to manage tasks and processes. Real-time systems require timely execution of tasks to meet specific deadlines, and queues help in organizing and prioritizing these tasks efficiently.

Depth-First Search explores as far as possible along each _______ before backtracking.

  • Edge
  • Path
  • Subgraph
  • Vertex
Depth-First Search explores as far as possible along each vertex before backtracking. It follows a recursive approach, visiting a vertex, exploring as far as possible, and then backtracking.

To find the total number of possible combinations in the coin change problem, we can modify the problem to use a _______ approach instead of minimizing the number of coins.

  • Combinatorial
  • Greedy
  • Maximization
  • Randomization
To find the total number of possible combinations in the coin change problem, we can modify the problem to use a combinatorial approach instead of minimizing the number of coins. This involves counting all possible ways to make change without focusing on the specific coin denominations used.

Topological sorting is essential in optimizing _______ schedules, ensuring that tasks are executed in the correct order.

  • Algorithm
  • Dependency
  • Execution
  • Job
Topological sorting is essential in optimizing job schedules, ensuring that tasks are executed in the correct order based on dependencies. It is commonly used in project management and task scheduling.

Compared to arrays, linked lists have _______ access time but _______ memory overhead.

  • Constant, Constant
  • Constant, Linear
  • Linear, Constant
  • Linear, Linear
Compared to arrays, linked lists have constant access time but linear memory overhead. Linked lists provide constant time for insertion and deletion at any position, but they require additional memory for storing the next pointer in each node.

Which step of the merge sort algorithm combines two sorted halves of an array into a single sorted array?

  • Divide
  • Merge
  • Sort
  • Split
The step of the merge sort algorithm that combines two sorted halves of an array into a single sorted array is the "Merge" step. In this phase, the sorted subarrays are merged to produce a larger sorted array.