Gate Questions

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 21

1. There are n unsorted arrays: A1, A2, …, An. Assume that n is odd.

Each of A1, A2, …,


An contains n distinct elements. There are no common elements between any two arrays.
The worst-case time complexity of computing the median of the medians of A1, A2, …,
An is ________.
(GATE CSE 2019)
O(n)
O(nlogn)
O(n2logn)
O(n2)
Answer (d)
2. An array of 25 distinct elements is to be sorted using quicksort. Assume that the pivot
element is chosen uniformly at random. The probability that the pivot element gets
placed in the worst possible location in the first round of partitioning (rounded off to 2
decimal places) is ________.
(GATE CSE 2019)
0.08
0.1
1
0
Answer (a)
3. Assume that the algorithms considered here sort the input sequences in ascending order. If the
input is already in ascending order, which of the following are TRUE?
I. Quicksort runs in Θ(n2) time
II. Bubblesort runs in Θ(n2) time
III. Mergesort runs in Θ(n) time
IV. Insertion sort runs in Θ(n) time
(GATE CSE 2016 Set 2)
I and II only
I and III only
II and IV only
I and IV only
Answer (d)
4. Consider the following array of elements.
〈89,19,50,17,12,15,2,5,7,11,6,9,100〉
The minimum number of interchanges needed to convert it into a max-heap is _______.
(GATE CSE 2015 Set 3)
4
5
2
3
Answer (d)
5. Which one of the following is the recurrence equation for the worst-case time complexity of
the Quicksort algorithm for sorting n (≥2) numbers? In the recurrence equations given in the
options below, c is a constant. (GATE CSE 2015 Set 1)
T(n) = 2T(n/2) + cn
T(n) = T(n-1) + T(1) + cn
T(n) = 2T(n-1) + cn
T(n) = T(n/2) + cn
Answer (b)
6. A priority queue is implemented as a Max-Heap. Initially, it has 5 elements. The level-order
traversal of the heap is: 10, 8, 5, 3, 2. Two new elements 1 and 7 are inserted into the heap in
that order. The level-order traversal of the heap after the insertion of the elements is _________.
(GATE CSE 2014 Set 2)
10, 8, 7, 3, 2, 1, 5
10, 8, 7, 2, 3, 1, 5
10, 8, 7, 1, 2, 3, 5
10, 8, 7, 5, 3, 2, 1
Answer (a)
7. An unordered list contains n distinct elements. The number of comparisons to find an element
in this list that is neither maximum nor minimum is _________.
(GATE CSE 2015 Set 2)
Θ(nlogn)
Θ(n)
Θ(logn)
Θ(1)
Answer (d)
8.You have an array of n elements. Suppose you implement quicksort by always choosing the
central element of the array as the pivot. Then the tightest upper bound for the worst-case
performance is ________.
(GATE CSE 2014 Set 3)
Θ(n2)
Θ(nlogn)
Θ(n)
None of the above
Answer (a)
9. Let P be a QuickSort Program to sort numbers in ascending order using the first element as
pivot. Let t1 and t2 be the number of comparisons made by P for the inputs {1, 2, 3, 4, 5} and {4,
1, 5, 3, 2}, respectively. Which one of the following holds?
(GATE CSE 2014 Set 1)
t1 = 5
t1 < t2
t1 > t2
t1 = t2
Answer (c)
10.Which of the following statement(s) is/are correct regarding the Bellman-Ford shortest path
algorithm?
P: Always finds a negative weighted cycle, if one exists.
Q: Finds whether any negative weighted cycle is reachable from the source.
(GATE CSE 2009)
P only
Q only
Both P and Q
Neither P nor Q
Answer (b)
11.The usual Θ(n2) implementation of Insertion Sort to sort an array uses linear search to
identify the position where an element is to be inserted into the already sorted part of the array.
If instead, we use binary search to identify the position, the worst-case running time will
__________.
(GATE CSE 2003)
Remain Θ(n2)
Become Θ(n(logn)2)
Become Θ(nlogn)
Become Θ(n)
Answer (a)
12.Randomized quicksort is an extension of quicksort where the pivot is chosen randomly. What
is the worst-case complexity of sorting n numbers using randomized quicksort?
(GATE CSE 2001)
O(n)
O(nlogn)
O(n2)
O(n!)
Answer (c)
13.If one uses a straight two-way merge sort algorithm to sort the following elements in
ascending order 20, 47, 15, 8, 9, 4, 40, 30, 12, 17, then the order of these elements after the
second pass of the algorithm is _________.
(GATE CSE 1999)
8, 9, 15, 20, 47, 4, 12, 17, 30, 40
8, 15, 20, 47, 4, 9, 30, 40, 12, 17
15, 20, 47, 4, 8, 9, 12, 30, 40, 17
4, 8, 9, 15, 20, 47, 12, 17, 30, 40
Answer (b)
14.A sorting technique is called stable if __________.
(GATE CSE 1999)
It takes O(nlogn) time
It maintains the relative order of occurrence of non-distinct elements
It uses divide and conquer paradigm
It takes O(n) space
Answer (b)
15.For merging two sorted lists of sizes m and n into a sorted list of size m+n, we require
comparisons of _________.
(GATE CSE 1995)
O(m)
O(n)
O(m+n)
O(logm + logn)
Answer (c)
16. Which one of the following statements is TRUE for all positive functions f(n)? [GATE CSE
2022]
(A) f(n2) = θ(f(n)2), when f(n) is a polynomial
(B) f(n2) = o(f(n)2)
(C) f(n2) = O(f(n)2), when f(n) is an exponential function
(D) f(n2) = Ω(f(n)2)
Solution: Correct answer is (A)
17. For parameters a and b, both of which are ω(1), T(n) = T(n1/a) + 1, and T(b) = 1. Then T(n)
is [GATE 2020]
(A) θ(logalogbn)
(B) θ(logabn)
(C) θ(logblogan)
(D) θ(log2log2n)
Solution: Correct answer is (A)
18.The Floyd-Warshall algorithm for all-pair shortest paths computation is based on [GATE
CSE 2016]
(A) Greedy Algorithm
(B) Divide-and-Conquer Paradigm
(C) Dynamic Programming Paradigm
(D) neither Greedy nor Divide-and-Conquer nor Dynamic Programming Paradigm
Solution: Correct answer is (C)
19. Which one of the following is the recurrence equation for the worst-case time complexity of
the Quicksort algorithm for sorting (n ≥ 2) numbers? In the recurrence equations given in the
options below, c is a constant. [GATE CSE 2015]
(A) T(n) = 2T(n/2) + cn
(B) T(n) = T(n-1) + T(0) + cn
(C) T(n) = 2T(n-1) + cn
(D) T(n) = T(n/2) + cn
Solution: Correct answer is (B)
20. An unordered list contains n distinct elements. The number of comparisons to find an
element in this list that is neither maximum nor minimum is [GATE CSE 2015]
(A) θ(n log n)
(B) θ(n)
(C) θ(log n)
(D) θ(1)
Solution: Correct answer is (D)
21. Consider the following array of elements: (89,19,50,17,12,15,2,5,7,11,6,9,100). The minimum
number of interchanges needed to convert it into a max-heap is [GATE CSE 2015]
(A) 4
(B) 5
(C) 2
(D) 3
Solution: Correct answer is (D)

22. The tightest lower bound on the number of comparisons, in the worst case, for comparison-
based sorting is of the order of [GATE CSE 2004]
(A) n
(B) n2
(C) n log n
(D) n log2 n
Solution: Correct answer is (C)
23. The problems 3-SAT and 2-SAT are [GATE CSE 2004]
(A) both in P
(B) both NP-Complete
(C) NP-Complete and in P respectively
(D) Undecidable and NP-Complete respectively
Solution: Correct answer is (C)

24. A sorting technique is called stable if: [GATE CSE 1999]


(A) It takes O(n log n) time
(B) It maintains the relative order of occurrence of non-distinct elements.
(C) It uses divide and conquers paradigm
(D) It takes O(n) space
Solution: Correct answer is (B)
25. For merging two sorted lists of sizes m and n into a sorted list of size m+n, we require
comparisons of [GATE CSE 1995]
(A) O(m)
(B) O(n)
(C) O(m+n)
(D) O(log m + log n)
Solution: Correct answer is (C)

26. Which of the following data structures is best suited for implementing a recursive algorithm?

a) Array
b) Linked list
c) Stack
d) Queue

Answer: c) Stack

Explanation: Recursion works on the principle of Last in First Out (LIFO), which is the same principle followed
by the Stack data structure.

27. Which of the following algorithms is an example of a greedy algorithm?

a) Quick Sort
b) Dijkstra’s shortest path algorithm
c) Bellman-Ford algorithm
d) Kruskal’s algorithm for minimum spanning tree
Answer: d) Kruskal’s algorithm for minimum spanning tree

Explanation: Greedy algorithms are those algorithms that make the locally optimal choice at each step in the
hope of finding a global optimum. Kruskal’s algorithm is a greedy algorithm as it chooses the edge with the
lowest weight and adds it to the minimum spanning tree.

28. Which of the following is a dynamic programming problem?

a) Longest Common Subsequence


b) Binary Search
c) Depth First Search
d) Breadth First Search

Answer: a) Longest Common Subsequence

Explanation: Dynamic programming is a technique where we break a problem down into smaller subproblems
and solve each subproblem only once. Longest Common Subsequence is a problem where we break down the
problem into smaller subproblems and solve them using dynamic programming.

29. Which of the following sorting algorithms has a worst-case time complexity of O(n^2)?

a) Merge Sort
b) Heap Sort
c) Quick Sort
d) Bubble Sort

Answer: d) Bubble Sort

Explanation: Bubble Sort is an inefficient sorting algorithm with a worst-case time complexity of O(n^2).

30. Which of the following algorithms is used to find the strongly connected components in a
directed graph?

a) Kruskal’s algorithm
b) Prim’s algorithm
c) Floyd-Warshall algorithm
d) Kosaraju’s algorithm

Answer: d) Kosaraju’s algorithm

Explanation: Kosaraju’s algorithm is used to find the strongly connected components in a directed graph.

31. Which of the following data structures is best suited for implementing a priority queue?

a) Array
b) Linked list
c) Stack
d) Heap
Answer: d) Heap

Explanation: Priority queues are used to maintain a set of elements with keys. A heap is the best data
structure to implement a priority queue because it provides efficient insertion, deletion, and retrieval of the
minimum (or maximum) element.

32. Which of the following algorithms is used to find the shortest path between two vertices in a
graph?

a) Breadth First Search


b) Depth First Search
c) Dijkstra’s shortest path algorithm
d) Bellman-Ford algorithm

Answer: c) Dijkstra’s shortest path algorithm

Explanation: Dijkstra’s algorithm is used to find the shortest path between two vertices in a graph.

33. Which of the following data structures is best suited for implementing a hash table?

a) Array
b) Linked list
c) Stack
d) Queue

Answer: a) Array

Explanation: Hash tables are implemented using arrays.

34. Which of the following algorithms is used to find the maximum flow in a flow network?

a) Kruskal’s algorithm
b) Prim’s algorithm
c) Ford-Fulkerson algorithm
d) Bellman-Ford algorithm

Answer: c) Ford-Fulkerson algorithm

Explanation: Ford-Fulkerson algorithm is used to find the maximum flow in a flow network.

35. Which of the following algorithms is used to find the minimum spanning tree of a weighted
graph?

a) Kruskal’s algorithm
b) Prim’s algorithm
c) Floyd-Warshall algorithm
d) Bellman-Ford algorithm

Answer: a) Kruskal’s algorithm or b) Prim’s algorithm


Explanation: Kruskal’s algorithm and Prim’s algorithm are both used to find the minimum spanning tree of a
weighted graph. Kruskal’s algorithm works by selecting the edges with the lowest weight until all vertices are
connected, while Prim’s algorithm starts with a single vertex and adds the minimum weight edges that connect
it to other vertices until all vertices are connected.

36. Which of the following algorithms is used to find the transitive closure of a directed graph?

a) Floyd-Warshall algorithm
b) Bellman-Ford algorithm
c) Kosaraju’s algorithm
d) Depth First Search

Answer: a) Floyd-Warshall algorithm

Explanation: Floyd-Warshall algorithm is used to find the transitive closure of a directed graph.

37. Which of the following algorithms is used to find the maximum subarray sum?

a) Merge Sort
b) Heap Sort
c) Quick Sort
d) Kadane’s algorithm

Answer: d) Kadane’s algorithm

Explanation: Kadane’s algorithm is used to find the maximum subarray sum.

38. Which of the following algorithms is used to find the articulation points in a graph?

a) Bellman-Ford algorithm
b) Floyd-Warshall algorithm
c) Depth First Search
d) Kruskal’s algorithm

Answer: c) Depth First Search

Explanation: Depth First Search is used to find the articulation points in a graph.

39. Which of the following algorithms is used to find the shortest path between all pairs of vertices
in a graph?

a) Breadth First Search


b) Depth First Search
c) Dijkstra’s shortest path algorithm
d) Floyd-Warshall algorithm

Answer: d) Floyd-Warshall algorithm


Explanation: Floyd-Warshall algorithm is used to find the shortest path between all pairs of vertices in a
graph.

40. Which of the following algorithms is used to find the longest increasing subsequence in a
sequence?

a) Merge Sort
b) Heap Sort
c) Quick Sort
d) Dynamic Programming

Answer: d) Dynamic Programming

Explanation: The longest increasing subsequence problem can be solved using dynamic programming.

41. Which of the following algorithms is used to find the topological order of a directed acyclic
graph?

a) Bellman-Ford algorithm
b) Floyd-Warshall algorithm
c) Depth First Search
d) Kahn’s algorithm

Answer: d) Kahn’s algorithm

Explanation: Kahn’s algorithm is used to find the topological order of a directed acyclic graph.

42. Which of the following data structures is best suited for implementing a breadth-first search
algorithm?

a) Array
b) Linked list
c) Stack
d) Queue

Answer: d) Queue

Explanation: Breadth-first search uses a queue data structure to traverse a graph.

43. Which of the following algorithms is used to find the maximum independent set in a graph?

a) Dijkstra’s algorithm
b) Bellman-Ford algorithm
c) Depth First Search
d) Bron-Kerbosch algorithm

Answer: d) Bron-Kerbosch algorithm

Explanation: Bron-Kerbosch algorithm is used to find the maximum independent set in a graph.
44. Which of the following algorithms is used to find the diameter of a tree?

a) Breadth First Search


b) Depth First Search
c) Dijkstra’s shortest path algorithm
d) Kruskal’s algorithm

Answer: b) Depth First Search

Explanation: Depth First Search is used to find the diameter of a tree.

45. Which of the following algorithms is used to find the longest path in a directed acyclic graph?

a) Breadth First Search


b) Depth First Search
c) Dijkstra’s shortest path algorithm
d) Bellman-Ford algorithm

Answer: b) Depth First Search

Explanation: Depth First Search is used to find the longest path in a directed acyclic graph.

46. Which of the following algorithms is used to find the minimum number of coins needed to make
change for a given amount?

a) Greedy algorithm
b) Depth First Search
c) Breadth First Search
d) Dijkstra’s shortest path algorithm

Answer: a) Greedy algorithm

Explanation: The minimum coin change problem can be solved using a greedy algorithm.

47. Which of the following algorithms is used to find the maximum flow in a network?

a) Dijkstra’s algorithm
b) Bellman-Ford algorithm
c) Ford-Fulkerson algorithm
d) Prim’s algorithm

Answer: c) Ford-Fulkerson algorithm

Explanation: Ford-Fulkerson algorithm is used to find the maximum flow in a network.


48. Which of the following algorithms is used to find the kth largest element in an unsorted array?

a) Quick Sort
b) Merge Sort
c) Heap Sort
d) Selection algorithm

Answer: d) Selection algorithm

Explanation: The selection algorithm can be used to find the kth largest element in an unsorted array.

49. Which of the following algorithms is used to find the maximum sum of a subarray with a given
sum constraint?

a) Merge Sort
b) Heap Sort
c) Quick Sort
d) Sliding Window algorithm

Answer: d) Sliding Window algorithm

Explanation: The maximum sum of a subarray with a given sum constraint can be found using the sliding
window algorithm.

50. Which of the following algorithms is used to find the minimum cut in a network?

a) Bellman-Ford algorithm
b) Floyd-Warshall algorithm
c) Ford-Fulkerson algorithm
d) Prim’s algorithm

Answer: c) Ford-Fulkerson algorithm

Explanation: Ford-Fulkerson algorithm is used to find the minimum cut in a network.

51. Which of the following algorithms is used to find the longest common subsequence between
two sequences?

a) Merge Sort
b) Heap Sort
c) Quick Sort
d) Dynamic Programming

Answer: d) Dynamic Programming

Explanation: The longest common subsequence problem can be solved using dynamic programming.
52. Which of the following algorithms is used to find the maximum matching in a bipartite graph?

a) Dijkstra’s algorithm
b) Bellman-Ford algorithm
c) Hopcroft-Karp algorithm
d) Kruskal’s algorithm

Answer: c) Hopcroft-Karp algorithm

Explanation: Hopcroft-Karp algorithm is used to find the maximum matching in a bipartite graph.

53. Which of the following algorithms is used to find the minimum vertex cover in a graph?

a) Dijkstra’s algorithm
b) Bellman-Ford algorithm
c) Depth First Search
d) Hungarian algorithm

Answer: d) Hungarian algorithm

Explanation: Hungarian algorithm is used to find the minimum vertex cover in a graph.

54. Which of the following algorithms is used to find the maximum weighted matching in a
bipartite graph?

a) Dijkstra’s algorithm
b) Bellman-Ford algorithm
c) Hungarian algorithm
d) Kruskal’s algorithm

Answer: c) Hungarian algorithm

Explanation: Hungarian algorithm is used to find the maximum weighted matching in a bipartite graph.

55. Which of the following algorithms is used to find the minimum path cover in a directed acyclic
graph?

a) Breadth First Search


b) Depth First Search
c) Dijkstra’s shortest path algorithm
d) Ford-Fulkerson algorithm

Answer: b) Depth First Search

Explanation: Depth First Search is used to find the minimum path cover in a directed acyclic graph.

56. Which of the following algorithms is used to find the minimum spanning tree in a weighted
graph?
a) Dijkstra’s algorithm
b) Prim’s algorithm
c) Bellman-Ford algorithm
d) Kruskal’s algorithm

Answer: b) Prim’s algorithm

Explanation: Prim’s algorithm is used to find the minimum spanning tree in a weighted graph.

57. Which of the following algorithms is used to find the all-pairs shortest paths in a weighted
graph?

a) Dijkstra’s algorithm
b) Floyd-Warshall algorithm
c) Bellman-Ford algorithm
d) Kruskal’s algorithm

Answer: b) Floyd-Warshall algorithm

Explanation: Floyd-Warshall algorithm is used to find the all-pairs shortest paths in a weighted graph.

58. Which of the following algorithms is used to find the convex hull of a set of points?

a) Graham’s scan
b) Quick Sort
c) Merge Sort
d) Heap Sort

Answer: a) Graham’s scan

Explanation: Graham’s scan is used to find the convex hull of a set of points.

59. Which of the following algorithms is used to find the maximum independent set in a bipartite
graph?

a) Dijkstra’s algorithm
b) Bellman-Ford algorithm
c) Depth First Search
d) König’s theorem

Answer: d) König’s theorem

Explanation: König’s theorem can be used to find the maximum independent set in a bipartite graph.
60. Which of the following algorithms is used to find the maximum clique in a graph?

a) Dijkstra’s algorithm
b) Bellman-Ford algorithm
c) Depth First Search
d) Bron-Kerbosch algorithm

Answer: d) Bron-Kerbosch algorithm

Explanation: Bron-Kerbosch algorithm is used to find the maximum clique in a graph.

61. Which of the following algorithms is used to find the chromatic number of a graph?

a) Dijkstra’s algorithm
b) Bellman-Ford algorithm
c) Depth First Search
d) Greedy algorithm

Answer: d) Greedy algorithm

Explanation: The chromatic number of a graph can be found using a greedy algorithm.

62. Which of the following algorithms is used to find the maximum flow in a network with multiple
sources and sinks?

a) Dijkstra’s algorithm
b) Bellman-Ford algorithm
c) Edmonds-Karp algorithm
d) Dinic’s algorithm

Answer: d) Dinic’s algorithm

Explanation: Dinic’s algorithm is used to find the maximum flow in a network with multiple sources and sinks.

63. Which of the following algorithms is used to find the shortest path between all pairs of vertices
in a graph with negative edges?

a) Dijkstra’s algorithm
b) Bellman-Ford algorithm
c) Floyd-Warshall algorithm
d) Kruskal’s algorithm

Answer: c) Floyd-Warshall algorithm

Explanation: Floyd-Warshall algorithm is used to find the shortest path between all pairs of vertices in a graph
with negative edges.
64. Which of the following algorithms is used to find the maximum flow in a network with
capacities that are fractional numbers?

a) Dijkstra’s algorithm
b) Bellman-Ford algorithm
c) Edmonds-Karp algorithm
d) Push-Relabel algorithm

Answer: d) Push-Relabel algorithm

Explanation: Push-Relabel algorithm is used to find the maximum flow in a network with capacities that are
fractional numbers.

65. Which of the following algorithms is used to find the minimum spanning tree in an undirected
graph with negative edges?

a) Dijkstra’s algorithm
b) Prim’s algorithm
c) Bellman-Ford algorithm
d) Kruskal’s algorithm

Answer: c) Bellman-Ford algorithm

Explanation: Bellman-Ford algorithm is used to find the minimum spanning tree in an undirected graph with
negative edges.

66. Which of the following algorithms is used to find the maximum flow in a network with
capacities that can change over time?

a) Dijkstra’s algorithm
b) Bellman-Ford algorithm
c) Edmonds-Karp algorithm
d) Ford-Fulkerson algorithm

Answer: d) Ford-Fulkerson algorithm

Explanation: Ford-Fulkerson algorithm is used to find the maximum flow in a network with capacities that can
change over time.

67. Which of the following algorithms is used to find the shortest path between two vertices in a
graph with negative edges?

a) Dijkstra’s algorithm
b) Bellman-Ford algorithm
c) Floyd-Warshall algorithm
d) Kruskal’s algorithm

Answer: b) Bellman-Ford algorithm


Explanation: Bellman-Ford algorithm is used to find the shortest path between two vertices in a graph with
negative edges.

68. Which of the following algorithms is used to find the maximum flow in a network with
capacities that are integers?

a) Dijkstra’s algorithm
b) Bellman-Ford algorithm
c) Edmonds-Karp algorithm
d) Ford-Fulkerson algorithm

Answer: c) Edmonds-Karp algorithm

Explanation: Edmonds-Karp algorithm is used to find the maximum flow in a network with capacities that are
integers.

69. Which of the following algorithms is used to find the minimum spanning tree in an undirected
graph with positive and negative edges?

a) Dijkstra’s algorithm
b) Prim’s algorithm
c) Bellman-Ford algorithm
d) Kruskal’s algorithm

Answer: c) Bellman-Ford algorithm

Explanation: Bellman-Ford algorithm is used to find the minimum spanning tree in an undirected graph with
positive and negative edges.

70. Which of the following algorithms is used to find the maximum flow in a network with
capacities that can be increased or decreased by a certain amount?

a) Dijkstra’s algorithm
b) Bellman-Ford algorithm
c) Edmonds-Karp algorithm
d) Push-Relabel algorithm

Answer: d) Push-Relabel algorithm

Explanation: Push-Relabel algorithm is used to find the maximum flow in a network with capacities that can
be increased or decreased by a certain amount.

71. Which of the following algorithms is used to find the shortest path between two vertices in a
graph with positive and negative edges?

a) Dijkstra’s algorithm
b) Bellman-Ford algorithm
c) Floyd-Warshall algorithm
d) Kruskal’s algorithm
Answer: b) Bellman-Ford algorithm

Explanation: Bellman-Ford algorithm is used to find the shortest path between two vertices in a graph with
positive and negative edges.

72. Which of the following algorithms is used to find the minimum cut in a network with capacities
that are integers?

a) Dijkstra’s algorithm
b) Bellman-Ford algorithm
c) Edmonds-Karp algorithm
d) Ford-Fulkerson algorithm

Answer: d) Ford-Fulkerson algorithm

Explanation: Ford-Fulkerson algorithm is used to find the minimum cut in a network with capacities that are
integers.

73. Which of the following algorithms is used to find the maximum matching in a general graph?

a) Hopcroft-Karp algorithm
b) Edmonds-Karp algorithm
c) Dinic’s algorithm
d) Ford-Fulkerson algorithm

Answer: c) Dinic’s algorithm

Explanation: Dinic’s algorithm is used to find the maximum matching in a general graph.

74. Which of the following algorithms is used to find the shortest path between all pairs of vertices
in a graph with positive and negative edges?

a) Dijkstra’s algorithm
b) Bellman-Ford algorithm
c) Floyd-Warshall algorithm
d) Kruskal’s algorithm

Answer: c) Floyd-Warshall algorithm

Explanation: Floyd-Warshall algorithm is used to find the shortest path between all pairs of vertices in a graph
with positive and negative edges.

75. Which of the following algorithms is used to find the minimum cut in a network with capacities
that can change over time?

a) Dijkstra’s algorithm
b) Bellman-Ford algorithm
c) Edmonds-Karp algorithm
d) Ford-Fulkerson algorithm
Answer: d) Ford-Fulkerson algorithm

Explanation: Ford-Fulkerson algorithm is used to find the minimum cut in a network with capacities that can
change over time.

76. Which of the following algorithms is used to find the articulation points in an undirected graph?

a) Dijkstra’s algorithm
b) Bellman-Ford algorithm
c) Tarjan’s algorithm
d) Hopcroft-Tarjan algorithm

Answer: c) Tarjan’s algorithm

Explanation: Tarjan’s algorithm is used to find the articulation points in an undirected graph.

77. Which of the following algorithms is used to find the bridges in an undirected graph?

a) Dijkstra’s algorithm
b) Bellman-Ford algorithm
c) Tarjan’s algorithm
d) Hopcroft-Tarjan algorithm

Answer: c) Tarjan’s algorithm

Explanation: Tarjan’s algorithm is used to find the bridges in an undirected graph.

78. Which of the following algorithms is used to find the maximum flow in a network with
capacities that are real numbers?

a) Dijkstra’s algorithm
b) Bellman-Ford algorithm
c) Edmonds-Karp algorithm
d) Ford-Fulkerson algorithm

Answer: d) Ford-Fulkerson algorithm

Explanation: Ford-Fulkerson algorithm is used to find the maximum flow in a network with capacities that are
real numbers.

79. Which of the following algorithms is used to find the maximum flow in a network with
capacities that can be increased or decreased by a real number?

a) Dijkstra’s algorithm
b) Bellman-Ford algorithm
c) Edmonds-Karp algorithm
d) Push-Relabel algorithm

Answer: d) Push-Relabel algorithm


Explanation: Push-Relabel algorithm is used to find the maximum flow in a network with capacities that can
be increased or decreased by a real number.

80. Which of the following algorithms is used to find the shortest path between all pairs of vertices
in a graph with positive edges?

a) Dijkstra’s algorithm
b) Bellman-Ford algorithm
c) Floyd-Warshall algorithm
d) Kruskal’s algorithm

Answer: c) Floyd-Warshall algorithm

You might also like