Advance Algorithm MCQ

Question 1 : Another name for Jarvis march algorithm to find convex hull is

1. Gift wrapping
2. Bin packing
3. Segment linking
4. Region mapping

Question 2 : Arrange the following in the increasing order of their asymptotic complexity in big theta notation 2n, log n, n! , n

1. 2n < log n < n! < n
2. 2n < n< n! < log n
3. n < log n < 2n < n!
4. log n < n < 2n < n!

Question 3 : The number of black nodes from the root to a node is the node's____ ______; the uniform number of black nodes in all paths from root to the leaves is called the ____ _____ of the redâ€“black tree.

1. Black depth, Black height
2. Black height, black depth
3. red depth, red height
4. red height, red depth

Question 4 : Let X is a problem that belongs to the class NP. Then which one of the following is TRUE?

1. There is no polynomial time algorithm for X.
2. If X can be solved deterministically in polynomial time, then P = NP.
3. If X is NP-hard, then it is NP-complete.
4. X may be undecidable.

Question 5 : In a B-tree of order n, root node contains how many minimum keys?

1. 1
2. n
3. n-1
4. (n - 1)/2

Question 6 : Recursion tree is used for?

1. solving recurrences
2. solving iterative relations
3. analyzing loops
4. calculating the time complexity of any code

Question 7 : How many cases are there in under master method?

1. 2
2. 3
3. 4
4. 5

Question 8 : The black height of a red black tree is

1. Black height of its root
2. Black height of a node
3. Red height of a node
4. Height of a tree

Question 9 : Closest pair algorithm using brute force performs which basic operation

1. Euclidean distance
2. Manhattan distance
3. Area
4. Radius

Question 10 : When to prefer Red-black trees over AVL trees?

1. When log(nodes) time complexity is needed.
2. When more search operations are needed.
3. When there are more insertions or deletions.
4. When tree must be balanced

Question 11 : Which of the terms is not used in a linear programming problem?

1. Slack variables
2. Objective function
3. Concave region
4. Feasible solution

Question 12 : If T(n) = T(n/2) + n, then the complexity will be as follows:

1. O(log n)
2. O(n)
3. O(n.log n)
4. O(n2)

Question 13 : Which method of amortized analysis keeps the same amortized cost for all the operations?

1. Aggregate Analysis
2. Accounting Method
3. Potential Method
4. Dynamic Table

Question 14 : In what time can an augmented path be found?

1. O(|E| log |V|)
2. O(|E|)
3. O(|E|2)
4. O(|E|2 log |V|)

Question 15 : In LPP, the optimal value of the objective function is attained at the points

1. Given by intersection of inequations with axes only
2. Given by intersection of inequations with x-axis only
3. Given by corner points of the feasible region.
4. Given by intersection of inequations with y-axis only

Question 16 : In a binomial tree, the key of a node is ______ the key of its parent.

1. greater than
2. greater than or equal to
3. less than
4. less than or equal to

Question 17 : Problems that cannot be solved by any algorithm are called?

1. tractable problems
2. intractable problems
3. undecidable problems
4. decidable problems

Question 18 : Let f1(n) and f2(n) denote respectively, the worst case and average case running time of an algorithm executed on an input of size n. Which of the following is always true?

1. f2(n) = Omega(f1(n))
2. f2(n) = theta(f1(n))
3. f2(n) = O(f1(n))
4. f2(n) = o(f1(n))

Question 19 : Push Relabel algorithm is used to find

1. finding a flow between source and sink that is maximum
2. finding a flow between source and sink that is minimum
3. finding the shortest path between source and sink
4. computing a minimum spanning tree

Question 20 : In a binary max heap containing n numbers, the smallest element can be found in time

1. O(n)
2. O(logn)
3. O(loglogn)
4. O(1)

Question 21 : For vectors p1 and p2 to check if p1 is clockwise from p2 with respect to origin(0,0) which of the following is true:

1. p1 Ã— p2 is +ve
2. p1 Ã— p2 is -ve
3. p1 Ã— p2 is 0
4. p1 and p2 are collinear, pointing in either opposite or same direction.

Question 22 : How many nodes a binomial tree Bk consists of?

1. K
2. 2k-1
3. 2k+1
4. 2k

Question 23 : The complexity of the ford fulkerson algorithm is

1. O(V2E)
2. O(|E|log|V|)
3. O(E|f*|)
4. O(V3)

Question 24 : BINOMIAL_HEAP_MERGE returns a root list H that is sorted by _____ degree

1. monotonically decreasing
2. monotonically increasing
3. random
4. Initially increasing, later decreasing

Question 25 : The flow from vertex u to vertex v is the negative of the flow in reverse direction is called as

1. Capacity constraint
2. Skew Symmetry
3. Flow conservation property
4. Residual Capacity

Question 26 : During the execution of BINOMIAL_HEAP_UNION, how many maximum roots of a given degree can be there on the root list of Binomial Heap H.

1. 2
2. 3
3. 1
4. 0

Question 27 : Which asymptotic notation is used to show loose upperbound

1. Big O
2. Small o
3. Theta
4. Omega

Question 28 : What is the special property of red-black trees and what root should always be?

1. A colour of a node is either red or black and root should always be black colour only
2. height of the tree
3. pointer to next node
4. A colour which is either green or black

Question 29 : Calculate complexity of the given recurrence equation. T(n) = 4T(n/2) + n2

1. Ï´(n)
2. Ï´(n logn)
3. Ï´(n2)
4. Ï´(n2 log n)

Question 30 : The running time of graham scan Algorithm for solving convex hull is(n=number of points in set Q).

1. O(n)
2. O(n.logn)
3. O(logn)
4. O(n^2)

• chevron_left
• 1
• 2
• chevron_right