The coin change problem involves finding the minimum number of _______ needed to make a particular _______.

  • Coins, value
  • Ways, denomination
  • Steps, target
  • Moves, sum
The correct option is "Coins, value." The coin change problem revolves around determining the minimum number of coins needed to reach a specific target value. The key elements are the types of coins (denominations) available and the target value to achieve.

Choosing the right _______ strategy can significantly impact the performance of the Ford-Fulkerson algorithm.

  • Flow augmentation
  • Initialization
  • Residual graph
  • Vertex selection
Choosing the right flow augmentation strategy is crucial in the Ford-Fulkerson algorithm. This strategy determines how much flow can be added to the current flow in each iteration, affecting the overall algorithm performance. Different augmentation strategies may lead to different convergence rates and efficiency.

The A* search algorithm uses a _______ function to estimate the cost of reaching the goal from a given state.

  • Admissible
  • Cost
  • Heuristic
  • Informed
A* utilizes a heuristic function to estimate the cost of reaching the goal from a given state. This heuristic guides the search by providing an informed guess about the remaining cost, helping A* prioritize paths likely to lead to the optimal solution efficiently.

Merge sort demonstrates _______ behavior, making it a suitable choice for sorting large datasets.

  • Backtracking
  • Divide-and-conquer
  • Dynamic programming
  • Greedy
Merge sort demonstrates divide-and-conquer behavior, as it recursively breaks down the sorting problem into smaller sub-problems, making it efficient for handling large datasets.

How is the coin change problem related to dynamic programming?

  • Dynamic programming is employed to solve subproblems efficiently and avoid redundant calculations.
  • Dynamic programming is only applicable to certain variations of the problem.
  • Dynamic programming is used to count the total number of coins, but not for optimization.
  • It isn't related to dynamic programming.
The coin change problem is related to dynamic programming as it involves solving subproblems efficiently and storing their solutions to avoid redundant calculations. Dynamic programming is used to find the optimal combination of coins to minimize the total count.

What data structure is commonly used in BFS to keep track of visited vertices?

  • Array
  • Linked List
  • Queue
  • Stack
A queue is commonly used in BFS to keep track of visited vertices. The queue follows the First In First Out (FIFO) principle, ensuring that vertices are processed in the order they are discovered.

Dijkstra's algorithm is more efficient than _______ for finding the shortest path from a single source vertex to all other vertices in a graph with non-negative edge weights.

  • Bellman-Ford algorithm
  • Depth-First Search
  • Kruskal's algorithm
  • Prim's algorithm
Dijkstra's algorithm is more efficient than Bellman-Ford algorithm for finding the shortest path in a graph with non-negative edge weights. Dijkstra's algorithm has a time complexity of O((V + E) log V), where V is the number of vertices and E is the number of edges.

Greedy algorithms are not suitable for solving the Knapsack Problem because they may not always provide the _______ solution.

  • Exact
  • Feasible
  • Optimal
  • Unique
Greedy algorithms may not always provide the optimal solution for the Knapsack Problem. While they make locally optimal choices at each step, the overall result may not be the most optimal solution.

The number of swaps performed by selection sort is _______ in the worst-case scenario.

  • O(1)
  • O(log n)
  • O(n)
  • O(n^2)
In the worst-case scenario, the number of swaps performed by selection sort is O(n^2). This is because, in each iteration, the algorithm selects the minimum element and swaps it with the element at the beginning, contributing to a quadratic number of swaps for a sorted array.

Describe the process of sorting an array using Insertion Sort step by step.

  • Build the sorted array one element at a time
  • Divide the array into subarrays for sorting
  • Multiply each element by a random factor
  • Swap elements until the smallest is at the end
The Insertion Sort process involves building the sorted array one element at a time. Each iteration takes an element from the unsorted part and inserts it into its correct position in the sorted part, shifting other elements accordingly.