B.tech Computer Algorithms
B.tech Computer Algorithms
Instructions.:
1) All questions are compulsory
2) Figures to the right indicate full marks
8
ii. The time that depends on the input: an already sorted sequence that
is easier to sort.
A) Process
B) Evaluation
C) Running
D) Input
iii. What is the other name of Dijkstra algorithm?
A) single-source shortest path problem
B) multiple-source shortest path problem
C) multiple-destination shortest path problem
D) single-destination shortest path problem
iv. Which of the following is not a variant of merge sort?
A) in-place merge sort
B) bottom up merge sort
C) top down merge sort
D) linear merge sort
v. When dynamic programming is applied to a problem, it takes far less
time as compared to other methods that don’t take advantage of
overlapping subproblems.
A) True
B) False
vi. Let S be an NP-complete problem and Q and R be two other problems
not known to be in NP. Q is polynomial time reducible to S and S is
polynomial-time reducible to R. Which one of the following statements
is true?
A) R is NP-complete
B) R is NP-hard
C) Q is NP-complete
D) Q is NP-hard
vii. Kruskal’s algorithm is a ______
A) divide and conquer algorithm
B) dynamic programming algorithm
C) greedy algorithm
D) approximation algorithm
viii. The worst case complexity of quick sort is _________
A) O(n)
B) O(log n)
C) O(n2)
D) O(n log n)
ix. Which of the following is an NP complete problem?
A) Hamiltonian cycle
8
B) Travelling salesman problem
C) Calculating chromatic number of graph
D) Finding maximum element in an array
x. Which of the following problems is NOT solved using dynamic
programming?
A) 0/1 knapsack problem
B) Matrix chain multiplication problem
C) Edit distance problem
D) Fractional knapsack problem
xi. The Data structure used in standard implementation of Breadth First
Search is?
A) Stack
B) Queue
C) Linked List
D) Tree
xii. Depth First Search is equivalent to which of the traversal in the
Binary Trees?
A) Pre-order Traversal
B) Post-order Traversal
C) Level-order Traversal
D) In-order Traversal
xiii. A greedy algorithm can be used to solve all the dynamic
programming problems.
A) True
B) False
xiv. An algorithm is
A) a piece of code to be executed.
B) a loosely written code to make final code.
C) a step by step procedure to solve problem.
D) all of the above.
Q.2. Solve any 2 of the following [14]
8
(2,3,5,7,1,5).