In a static array, the size is _______ at compile time, whereas in a dynamic array, the size can be _______ at runtime.

  • Fixed, Fixed
  • Fixed, Variable
  • Variable, Fixed
  • Variable, Variable
In a static array, the size is fixed at compile time, while in a dynamic array, the size can be changed at runtime to accommodate varying data requirements.

Radix sort is generally faster than comparison-based sorting algorithms for sorting _______ integers.

  • Binary
  • Large
  • Prime
  • Small
Radix sort is generally faster than comparison-based sorting algorithms for sorting small integers because it takes advantage of the fixed-size nature of integers and avoids comparisons.

How is the Knapsack Problem different from other optimization problems?

  • It aims to minimize the number of selected items.
  • It does not consider any constraints; it's about finding the absolute optimum.
  • It focuses on maximizing the total value of selected items within certain constraints.
  • It involves minimizing the total weight of selected items.
The Knapsack Problem is distinct as it specifically aims to maximize the total value of selected items within certain constraints, making it a constrained optimization problem. Other optimization problems may have different objectives or constraints.

Insertion Sort is a _______ sorting algorithm that builds the final sorted array one _______ at a time.

  • Comparison, element
  • Divide and conquer, subset
  • Incremental, element
  • Simple, pass
Insertion Sort is an incremental sorting algorithm that builds the final sorted array one element at a time. It iterates through the array, comparing and inserting elements in their correct positions.

Regular expression matching involves searching for patterns in _______.

  • Arrays
  • Numbers
  • Strings
  • Text
Regular expression matching involves searching for patterns in text. Regular expressions are powerful tools for pattern matching and manipulation in strings.

Suppose you're tasked with optimizing network flow in a transportation system where each edge represents a road with a specific capacity. How would you apply the Ford-Fulkerson algorithm in this scenario?

  • Apply the Ford-Fulkerson algorithm to determine the maximum flow between source and destination nodes, adjusting capacities based on traffic conditions.
  • Implement the Ford-Fulkerson algorithm to minimize the total distance traveled on the roads in the transportation system.
  • Utilize the Ford-Fulkerson algorithm to find the shortest paths between each source and destination in the transportation network.
  • Utilize the Ford-Fulkerson algorithm to randomly assign flow values to each road in the transportation network.
In this scenario, the Ford-Fulkerson algorithm is applied to determine the maximum flow between source and destination nodes. It adjusts the capacities on each road based on traffic conditions, optimizing the overall network flow in the transportation system.

Which traversal technique does DFS primarily employ when traversing a graph?

  • Breadth-First Search (BFS)
  • Level-Order Traversal
  • Post-order Traversal
  • Pre-order Traversal
DFS primarily employs Pre-order Traversal when traversing a graph. In Pre-order Traversal, the algorithm visits the root node, then recursively performs Pre-order Traversal on the left subtree and the right subtree.

In the LIS problem, "patience" refers to the ability to _______ and _______ sequences of numbers.

  • Merge, combine
  • Merge, divide
  • Split, combine
  • Split, merge
In the Longest Increasing Subsequence (LIS) problem, "patience" refers to the ability to split and combine sequences of numbers. The algorithm involves finding the longest increasing subsequence in a given sequence.

The patience sorting algorithm is a technique inspired by a card game called _______.

  • Go Fish
  • Poker
  • Rummy
  • Solitaire
The patience sorting algorithm is inspired by the card game Solitaire. In this algorithm, the process of sorting is similar to organizing a deck of cards in the game of Solitaire.

What is the time complexity of binary search on a sorted array?

  • O(1)
  • O(log n)
  • O(n)
  • O(n^2)
The time complexity of the binary search algorithm on a sorted array is O(log n), where 'n' is the number of elements in the array. This logarithmic time complexity makes binary search highly efficient for large datasets.