MCQ Bank
Breadth-first search is a traversal strategy for_________.
- A) Array
- B) Tree
- C) Link List
- D) Graph
If you find yourself in maze the better traversel approach will be :
- A) BFS and DFS both are valid
- B) BFS
- C) DFS
- D) Level order
Each time we traverse graph by Breadth-first search algorithm, we count the distance from _________
- A) starting node
- B) right most node
- C) neighbors of the starting node
- D) left most node
For traversing the graphs, _____________can be visualized as a wave front propagating inward towards root node.
- A) Depth-first Search
- B) Breadth-first search
- C) Binary search
- D) Linear search
Time complexity of activity selection algorithm is _________.
- A) O(NlogN)
- B) O(logN)
- C) O(N)
- D) O(logN2)
For ____________ graphs, there is no distinction between forward and back edges.
- A) large
- B) directed
- C) undirected
- D) small
If the graph is represented using an adjacency list, then Depth-first search takes __________ time.
- A) O(V^2)
- B) O(E + 1)
- C) O(V)
- D) O(V + E)
A _____________ w is adjacent to vertex v if there is an edge from v to w.
- A) cycle
- B) loop
- C) acyclic
- D) vertex
Which graph traversal algorithm uses a stack to keep track of vertices?
- A) Depth First Search
- B) Breadth First Search
- C) Greedy Algorithm
- D) Divide and Conquer
DFS or BFS yields a ___________ of the graph.
- A) Simple Tree
- B) Free Tree
- C) Spanning tree
- D) Traversed Tree
Graphs are important __________ model for many application problems.
- A) Haphazard
- B) Unpredictable
- C) Unsystematic
- D) Mathematical
__________________ data structure is used to perform the Breadth-first search.
- A) Stack
- B) Queue
- C) Tree
- D) Array
There are _____________ ways of representing graphs.
- A) 4
- B) 3
- C) 2
- D) 1
In Activity scheduling algorithm, the width of a rectangle ____________
- A) Is always ignored
- B) Indicates the duration of an activity
- C) Directs towards recursion
- D) Should be maximized
Which type of algorithm is harder to prove the correctness?
- A) Brute Force
- B) Greedy
- C) Dynamic Programming
- D) Divide and Conquer
A _________ cycle is a cycle that visits every edge of the graph exactly once.
- A) Undirected
- B) Directed
- C) Eulerian
- D) Loop
Huffman algorithm generates an optimum _______ code.
- A) Infix
- B) Postfix
- C) Prefix
- D) None of the given options
In Fractional Knapsack problem, the goal is to ___________
- A) maximize the value of items without exceeding the total weight limit of W
- B) minimize the value of items even if exceeding the total weight limit of W
- C) maximize the value of items even if exceeding the total weight limit of W
- D) minimize the value of items without exceeding the total weight limit of W
In general in comparison with Fractional Knapsack problem, ______________
- A) Both are easy to solve
- B) We cannot compare them
- C) 0-1 knapsack problem is very easy to solve
- D) 0-1 knapsack problem is hard to solve
In Activity scheduling algorithm, each activity is represented by a __________
- A) Square
- B) Circle
- C) Rectangle
- D) Triangle