In the context of WAN optimization, ____ balancing refers to distributing traffic across multiple network paths.
- Load
- Traffic
- Path
- Link
In the context of WAN optimization, load balancing refers to distributing traffic across multiple network paths.
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.
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.
The in-place nature of Insertion Sort makes it suitable for sorting _______ data structures.
- Hash Tables
- Linked Lists
- Priority Queues
- Trees
The in-place nature of Insertion Sort makes it suitable for sorting linked lists. Since it only requires constant extra memory space, it's advantageous for scenarios where memory allocation is a concern.
The Fibonacci sequence is defined by the recurrence relation F(n) = F(n-1) + F(n-2), where F(n) represents the _______ Fibonacci number.
- 1st
- 2nd
- 3rd
- 4th
In the recurrence relation F(n) = F(n-1) + F(n-2), F(n) represents the (n)th Fibonacci number, the sum of the two preceding numbers in the sequence. So, it represents the 2nd Fibonacci number in this context.