MCQ Bank
In digraph G=(V,E) ;G has cycle if and only if
- A) The DFS forest has both back and forward edge
- B) BFS forest has forward edge
- C) The DFS forest has forward edge.
- D) The DFS forest has back edge
In general, a graph G = (V,E) consists of a ___________ and E, a binary relation on V called edges.
- A) Infinite set of nodes
- B) Infinite set of vertices V
- C) Infinite set of objects
- D) Finite set of vertices V
In Activity selection problem, intuitively _________.
- A) We do not like long activities
- B) There are always short activities as input
- C) Duration of the activities does not matter
- D) Short activities are not attractive
Which of the following is true about Huffman Coding?
- A) In Huffman coding, no code is prefix of any other code
- B) Huffman coding may become lossy in some cases
- C) Huffman coding is not an efficient coding way
- D) Huffman Codes may not be optimal lossless codes in some cases
In a digraph, the number of edges coming in of a vertex is called the __________ of that vertex.
- A) Out-degree
- B) Complete degree
- C) In-degree
- D) Node
For graph traversal, Breadth-first search strategy ________
- A) Can be both recursive and non-recursive
- B) Cannot be recursive
- C) is always recursive
- D) Cannot be non-recursive
Back edge is:
- A) (u, v) where v is an ancestor of u in the tree.
- B) (u, v) where u is a mid of v in the tree.
- C) (u, v) where u is an ancestor of v in the tree.
- D) (u, v) where v is a predecessor of u in the tree.
Bag is a _________
- A) data structure
- B) program
- C) type of algorithm
- D) compiler
Graphs can be represented by an _________ and____________.
- A) adjacency list, adjacency Matrix
- B) adjacency Right, adjacency Left
- C) Binary, Linear
- D) Queue, Stack
Which of the following algorithms solves the fractional knapsack problem most effectively?
- A) Greedy algorithm
- B) Dynamic programming
- C) Backtracking
- D) Divide and conquer
In general in comparison with Fractional Knapsack problem, ______________
- A) We cannot compare them
- B) Both are easy to solve
- C) 0-1 knapsack problem is very easy to solve
- D) 0-1 knapsack problem is hard to solve
For graph traversal, Breadth-first search strategy ________
- A) is always recursive
- B) Can be both recursive and non-recursive
- C) Cannot be non-recursive
- D) Cannot be recursive
For traversing the graphs, _____________can be visualized as a wave front propagating inward towards root node.
- A) Depth-first Search
- B) Linear search
- C) Binary search
- D) Breadth-first search
In digraph G=(V,E) ;G has cycle if and only if
- A) The DFS forest has both back and forward edge
- B) BFS forest has forward edge
- C) The DFS forest has forward edge.
- D) The DFS forest has back edge
Huffman algorithm generates an optimum _______ code.
- A) None of the given options
- B) Infix
- C) Postfix
- D) Prefix
Using ASCII standard the string “greedy” will be encoded with
- A) 48 bits
- B) 40 bits
- C) 44 bits
- D) 120 bits
In undirected graph, by convention all the edges are called _________ edges.
- A) Forward
- B) Back
- C) Cross
- D) Both forward and back
Keeping in mind the shortest-path, if given scenarios occur in computer networks like the internet where data packets have to be routed. The vertices are_________and Edges are _____________which may be wired or wireless.
- A) Communication links, routers
- B) Internet, routers
- C) Routers, communication links
- D) Routers, internet
A free tree with n _________ have exactly n-1 _________.
- A) vertices,edges
- B) edges,vertices
- C) nodes,vertices
- D) vertices,nodes
Which technique is used in the implementation of Kruskal solution for the MST?
- A) Dynamic Programming Technique
- B) The algorithm combines more than one of the above techniques i.e. Divide-and-Conquer and Dynamic Programming
- C) Greedy Technique
- D) Divide-and-Conquer Technique