0% found this document useful (0 votes)
479 views

CS502 Mcqs MidTerm by Vu Topper RM

This document provides a set of 40 multiple choice questions related to algorithms for a midterm exam. The questions cover topics like time complexity analysis, sorting algorithms like quicksort, mergesort, and heapsort, and algorithm design techniques like dynamic programming and greedy algorithms.

Uploaded by

Afaq Mughal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
479 views

CS502 Mcqs MidTerm by Vu Topper RM

This document provides a set of 40 multiple choice questions related to algorithms for a midterm exam. The questions cover topics like time complexity analysis, sorting algorithms like quicksort, mergesort, and heapsort, and algorithm design techniques like dynamic programming and greedy algorithms.

Uploaded by

Afaq Mughal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

CS-502 Fundamentals Of Algorithms

Update MCQS For Mid Term


Solve By Vu Topper RM

80 To 100% Marks

For More Help Contact What’s app 03224021365


Question No: 01 (Marks:1) Vu-Topper RM
There are __________ entries in the Edit Distance Matrix.
A. ϴ (n)
B. ϴ (n2) Page 84
C. ϴ (n+2)
D. ϴ (n + 100)

Question No: 02 (Marks:1) Vu-Topper RM


For average-case time analysis of Quick sort algorithm, Pivot selection
is on average basis from ______
A. All possible random values Page 50
B. Pivot is input separately
C. Values greater than 5

Question No: 03 (Marks:1) Vu-Topper RM


As per algorithm of Dynamic Programming, we need to store
A. First sub-problem only
B. Best solution only
C. Intermediate sub-problems Page 75
D. Final solution only

Question No: 04 (Marks:1) Vu-Topper RM


In chain matrix multiplication, table is filled _________ to find the
multiplication of matrix.
A. row wise
B. column wise
C. diagonally
D. bottom-to-up Page 86

Question No: 05 (Marks:1) Vu-Topper RM


The only way to convert a string of i characters into the empty string is
with i deletions, represented as
A. E(0.j) =j
B. E(i.j) = 1
C. E(0.i) = j
D. E (i.0)=I Page 78

Question No: 06 (Marks:1) Vu-Topper RM


If there are θ (n ) entries in edit distance matrix then the total running
2

time is:
A. θ (n)
B. θ (1)
C. θ (n2) Page 84
D. θ (n logn)

For More Help Contact What’s app 03224021365


Question No: 07 (Marks:1) Vu-Topper RM
In average –case time analysis of quick sort algorithm , the most
balanced case for partion is when we divide the list of elements into _.
A. Equal no. of pieces as of input elements
B. Single piece exactly
C. Two nearly equal pieces
D. Three nearly equal pieces

Question No: 08 (Marks:1) Vu-Topper RM


If matrix A of dimension p x q is multiply with matrix B of dimension q
x r, then each entry in resultant matrix takes _______ time.
A. O (q) Page 84
B. (1)
C. (p x q)
D. (q x r)

Question No: 09 (Marks:1) Vu-Topper RM


Fibonacci Sequence was named on ______, a famous mathematician in
12th Century.
A. Fred Brooks
B. Grady Booch
C. Leonardo Pisano Page 73
D. Edgar F. Codd

Question No: 10 (Marks:1) Vu-Topper RM


In quick sort algorithm, we choose pivot___________.
A. Always the smallest element
B. Greater than 5
C. Randomly Page 35
D. Less than 5

Question No: 11 (Marks:1) Vu-Topper RM


For comparison-based sorting algorithms, it is possible to sort more
efficiently than Omega n log(n) time.
A. Always
B. Sometimes not
C. NOT Page 54
D. Sometimes

Question No:12 (Marks:1) Vu-Topper RM


The sequence of merge sort algorithm is:
A. Divide Combine-Conquer
B. Conquer-Divide-Combine
C. Divide-Conquer-Combine Page 27
D. Combine-Divide-Conquer

For More Help Contact What’s app 03224021365


Question No: 13 (Marks:1) Vu-Topper RM
In ______ Knapsack Problem, limitation is that an item can either be
put in the bag or not. Fractional items are not allowed.
A. 0
B. 1
C. 0/1 Page 91
D. Fractional

Question No: 14 (Marks:1) Vu-Topper RM


In Selection algorithm, we assume pivot selection takes theta _______
running time.
A. n Page 36
B. n2
C. n3
D. log (n)

Question No: 15 (Marks:1) Vu-Topper RM


In Heap Sort algorithm (using max heap), when every time maximum
elements removed from top ________.
A. We call merge Sort Algorithm
B. it becomes Order n2 Algorithm
C. Divide and Conquer strategy helps us
D. We are left with a hole Page 41

Question No: 16 (Marks:1) Vu-Topper RM


_________ is a method of solving a problem in which we check all
possible solutions to the problem to find the solution we need.
A. Plane-Sweep Algorithm
B. Sorting Algorithm
C. Brute-Force Algorithm Google
D. Greedy approach

Question No: 17 (Marks:1) Vu-Topper RM


The worst case running time of Quick sort algorithm _____.
A. Is quadratic
B. Is linear
C. Cannot be quadratic
D. ls always Exponential

Question No: 18 (Marks:1) Vu-Topper RM


In max heap (for Heap Sort algorithm), when every time maximum
element is removed from top we replace it with _____ leaf in the tree.
A. Last Page 41
B. First
C. Any

For More Help Contact What’s app 03224021365


D. Second last

Question No: 19 (Marks:1) Vu-Topper RM


Quick sort algorithm was developed by –
A. AlferdAho
B. Sedgewick
C. John Vincent Atanasoff
D. Tony Hoare Google

Question No: 20 (Marks:1) Vu-Topper RM


If Matrix-A has dimensions “3×2” and Matrix-B has dimensions “2×3”,
then multiplication of Matrix-A and Matrix-B will result a new Matrix-
C having dimensions.
A. 3×2
B. 2×3
C. 2×2
D. 3×3

Question No: 21 (Marks:1) Vu-Topper RM


In Sorting the key value or attribute_____ from an ordered domain.
A. Must be Page 39
B. Not always
C. May be
D. Occasionally

Question No: 22 (Marks:1) Vu-Topper RM


Result of asymptotical analysis of n(n -3) and 4n*n is that _______
A. n(n-1) is asymptotically Less
B. n(n-1) is asymptotically Greater
C. Both are asymptotically Not equivalent
D. Both are asymptotically Equivalent Page 23

Question No: 23 (Marks:1) Vu-Topper RM


Floor and ceiling are ______ to calculate while analyzing algorithms
A. Very easy
B. 3rd Option is missing
C. Usually considered difficult
D. 4th Option is missing

Question No: 24 (Marks:1) Vu-Topper RM


____ of reference is an important fact of current processor technology.
A. Defining
B. Assigning
C. Locality Page 8
D. Formality

For More Help Contact What’s app 03224021365


Question No: 25 (Marks:1) Vu-Topper RM
In max-heap, largest element is stored at root node. Where is the
smallest element stored?
A. Right Node
B. Leaf Node
C. Middle Node
D. Left Node

Question No: 26 (Marks:1) Vu-Topper RM


Which of the following is calculated with Big Omega notation?
A. Medium bounds
B. Upper bounds
C. Lower bounds Page 25
D. Both upper and lower bounds

Question No: 27 (Marks:1) Vu-Topper RM


Edit distance algorithm based on ________ strategy
A. Greedy
B. Dynamic Programming Page 81
C. Divide and Conquer
D. Searching

Question No: 28 (Marks:1) Vu-Topper RM


In Heapsort Algorithm, total time taken by heapify procedure is ____
A. O (log n) Page 43
B. (log2 n)
C. (n log n)
D. (n2 log n)

Question No: 29 (Marks:1) Vu-Topper RM


Al-Khwarizmi was a/an _______
Artist
A. Astronomer
B. Mathematication Page 7
C. Khalifah

Question No: 30 (Marks:1) Vu-Topper RM


When matrix A of 5x3is multiply with metric B of 3×4 then the number
of multiplication required is: Not found exactly
A. 15
B. 12
C. 36
D. 60

For More Help Contact What’s app 03224021365


Question No: 31 (Marks:1) Vu-Topper RM
Pseudo code of algorithms are to be read by _______.
A. People Page 12
B. RAM
C. Computer
D. Compiler

Question No: 32 (Marks:1) Vu-Topper RM


The sieve technique is a special case, where the number of sub-
problems is Just_________
A. P Page 34
B. 2
C. 3
D. 4

Question No: 33 (Marks:1) Vu-Topper RM


When a recursive algorithm revisits the same problem over and over
again, we say that the optimization problem has ________ sub-
problems.
A. Overlapping Google
B. Over costing
C. Optimized
D. Three

Question No: 34 (Marks:1) Vu-Topper RM


In order to say anything meaningful about our algorithms, it will be
important for us to settle on a ______.
A. Java Program
B. C++ Program
C. Pseudo program
D. Mathematically model of computation

Question No: 35 (Marks:1) Vu-Topper RM


Merge sort is based on _______.
A. Brute-force
B. Plan-sweep
C. Axis-sweep
D. Divide and Conquer

Question No: 36 (Marks:1) Vu-Topper RM


What time does Merge Sort algorithm take in order to sort an array of
‘n’ numbers?
A. (n)
B. (log n)
C. (n^2)

For More Help Contact What’s app 03224021365


D. (n log n)

Question No: 37 (Marks:1) Vu-Topper RM


algorithm, the first step is to ___________.
A. Call Build-Heap procedure Page 46
B. Sort the array in descending order
C. Call Heapify procedure
D. Find the number of input elements

Question No: 38 (Marks:1) Vu-Topper RM


The definition of theta-notation relies on proving ________ asymptotic
bound.
A. One
B. Lower
C. Upper
D. Both lower & upper Page 25

Question No: 39 (Marks:1) Vu-Topper RM


In merge sort algorithm, to merge two lists of size n/2 to a list of size n,
takes _______ time.
A. Theta (n) Page 32
B. Theta log(n)
C. Theta log2(n)
D. Theta n log(n)

Question No: 40 (Marks:1) Vu-Topper RM


We can make _______ recursive calls in Fibonacci Sequence.
A. Infinite
B. Finite Google
C. Only one
D. Zero

Question No: 41 (Marks:1) Vu-Topper RM


Following is NOT the application of Edit Distance problem.
A. Speech recognition
B. Spelling Correction
C. Ascending Sort Page 76
D. Computational Molecular Biology

Question No: 42 (Marks:1) Vu-Topper RM


In plane sweep approach, a vertical line is swept across the 2d-plane
and structure is used for holding the maximal points lying to the left of
the sweep line.
A. Tree
B. Array

For More Help Contact What’s app 03224021365


C. Queue
D. Stack

Question No: 43 (Marks:1) Vu-Topper RM


Time will vary according to the nature of input data.
_____ time is the maximum running time over all legal inputs.
A. Worst-case Page 13
B. Average-case
C. Best-case
D. Good-case

Question No: 44 (Marks:1) Vu-Topper RM


Efficient algorithm requires less computational…
A. Memory
B. Running Time
C. Memory and Running Time Page 9
D. Energy

Question No: 45 (Marks:1) Vu-Topper RM


Selection algorithm takes theta ______
A. (n2)
B. (n)
C. log(n)
D. n log(n)

Question No: 46 (Marks:1) Vu-Topper RM


Time complexity of Dynamic Programming based algorithm for
computing the minimum cost of Chain Matrix Multiplication is ______
A. Log n
B. n
C. n^2 (n square)
D. n^3 (n cube) Page 90

Question No: 47 (Marks:1) Vu-Topper RM


The Iteration method is used for ______
A. Solving Recurrence relations Page 31
B. Merging elements in Merge sort
C. Comparing sorting algorithms only
D. Dividing elements in Merge sort

Question No: 48 (Marks:1) Vu-Topper RM


In 3-Dimensional space, a point P has ______ coordinate(s).
A. (X, Y)
B. (X, 0)
C. (0, Y)

For More Help Contact What’s app 03224021365


D. (X,Y, Z)

Question No: 49 (Marks:1) Vu-Topper RM


Chain matrix multiplication problem can be solved through ______
strategy.
A. Dynamic programming Page 85
B. Greedy
C. Divide and conquer
D. Sorting

Question No: 50 (Marks:1) Vu-Topper RM


Merge sort have running time….running time of Heap sort. Not found
exactly
A. Greater than
B. Less than Google
C. Equal to
D. Different than

Question No: 51 (Marks:1) Vu-Topper RM


The Omega-notation allows us to state only the asymptotic ___ bounds.
A. Middle
B. Lower Page 25
C. Upper
D. Both lower & upper

Question No: 52 (Marks:1) Vu-Topper RM


Both lower &upperSorting can be in ________
A. Random order
B. Increasing order only
C. Decreasing order only
D. Both Increasing and Decreasing order

Question No: 53 (Marks:1) Vu-Topper RM


Quicksort is a/an ______ and ________ sorting algorithm.
A. Not in place, not stable one
B. In place , not stable one Page 54
C. In place , stable one
D. Not in place , stable one

Question No: 54 (Marks:1) Vu-Topper RM


Consider three matrices X,Y,Z of dimensions 1×2, 2×3,3×4
respectively. The number of multiplications of (XY) Z is:
A. 18
B. 32
C. 24

For More Help Contact What’s app 03224021365


D. 30

Question No: 55 (Marks:1) Vu-Topper RM


In Dynamic Programming, our approach is to _________
A. Express the problem non-recursively
B. Build the solution in a bottom-up fashion Page 75
C. Develop the solution in a top-down fashion
D. Input several sub-problems simultaneously

Question No: 56 (Marks:1) Vu-Topper RM


The knapsack problem is optimally solved by using brute force
algorithm.Counting sort is suitable to sort the elements in range 1 to K;
A. K is large
B. K is small Page 57
C. K may be large or small
D. None

Question No: 57 (Marks:1) Vu-Topper RM


Matrix multiplication is a (n) ________ operation.
A. Commutative
B. Associative Page 85
C. Neither commutative nor associative
D. Commutative but not associative

Question No: 58 (Marks:1) Vu-Topper RM


In Dynamic Programming approach, solution is modified / changed
A. Always once
B. At each stage Google
C. Only for specific problems
D. At 4th stage only

Question No: 59 (Marks:1) Vu-Topper RM


In Knapsack problem, the goal is to put items in the Knapsack such that
the value of the items is _______ subject to weight limit of knapsack.
A. Minimized
B. Decreased
C. Maximized Page 91
D. None of the given options

Question No: 60 (Marks:1) Vu-Topper RM


An in-place sorting algorithm is one that ________ uses additional
array for storage.
A. Always
B. Permanently
C. Does not Page 54

For More Help Contact What’s app 03224021365


D. Sometime

Question No: 61 (Marks:1) Vu-Topper RM


Dynamic Programming is a problem-solving approach in which___
A. Problem is solved in Zero time
B. Solution is developed only at final stage
C. Both are correct
D. Both are incorrect Google

Question No: 62 (Marks:1) Vu-Topper RM


In Fibonacci sequence, each term is calculated by____ previous__
terms.
A. Subtracting, Two
B. Adding, Three
C. Adding, Two Page 73
D. Multiplying, Two

Question No: 63 (Marks:1) Vu-Topper RM


Dynamic programming formulation of the matrix chain multiplication
problem will store the solutions of each sub problem in an
A. Class
B. Array
C. Table
D. Variable

Question No: 64 (Marks:1) Vu-Topper RM


Sorting is performed on the basis of ___________.
A. Computational resources
B. Asymptotic notation
C. Summation
D. Some key value of attribute Page 39

Question No: 65 (Marks:1) Vu-Topper RM


In Heap Sort algorithm, we call Build-heap procedure ____________.
A. Twice
B. Thrice
C. Only once Page 46
D. As many times as we need

Question No: 66 (Marks:1) Vu-Topper RM


In the statement “output P[1].x, P[1].y”, the number of times elements
of P are accessed is _______.
A. 1
B. 2 Page 14
C. 3

For More Help Contact What’s app 03224021365


D. 4

Question No: 67 (Marks:1) Vu-Topper RM


_______ provides us more accurate result when input values are not
closer with each other
A. Mode
B. Mean
C. Average
D. Median Page 34

Question No: 68 (Marks:1) Vu-Topper RM


The process of ______ ends when you are left with such tiny pieces
remaining that it is trivial to solve them.
A. Brute-force
B. Plan-sweep
C. Axis-sweep
D. Divide and Conquer

Question No: 69 (Marks:1) Vu-Topper RM


Rank of an element can be defined as ___________.
A. One minus the number of elements that are smaller
B. Two plus the number of elements that are greater
C. One plus the number of elements that are smaller Page 34
D. Two minus the number of elements that are smaller

Question No: 70 (Marks:1) Vu-Topper RM


If the time complexity of an algorithm is given by O (1), then its time
complexity would be
A. Polynomial
B. Exponential
C. Constant Google
D. Average

Question No: 71 (Marks:1) Vu-Topper RM


The asymptotic growth of n(n+1)/2 is:
A. O(n)
B. O(n2)
C. O(n+2)
D. O(n log n)

Question No: 72 (Marks:1) Vu-Topper RM


Approach of solving geometric problems by sweeping a line across the
plane is called _____ sweep.
A. Line
B. Plane Page 18

For More Help Contact What’s app 03224021365


C. Cube
D. Box

Question No: 73 (Marks:1) Vu-Topper RM


In Sieve technique, we solve the problem
A. In recursive manner Page 34
B. Non recursively
C. Using Merge Sort algorithm
D. Using Brute force technique

Question No: 74 (Marks:1) Vu-Topper RM


One of the limitation in 0/1 knapsack is that an item can either be ____
in the bag or not.
A. Use
B. Put Page 91
C. Move
D. Store

Question No: 75 (Marks:1) Vu-Topper RM


Which one is not passed as parameter in Quick sort algorithm?
A. End of the array
B. Start of the array
C. Middle of the array
D. Array (containing input elements) Google

Question No: 76 (Marks:1) Vu-Topper RM


In the analysis of Selection algorithm, we get the convergent ______
A. Harmonic
B. Linear
C. Arithmetic
D. Geometric Page 37

Question No: 77 (Marks:1) Vu-Topper RM


A Random Access Machine (RAM)is an idealized machine withrandom
access memory.
A. Infinite large Page 10
B. 512 MB
C. 256 MB
D. 2 GBs

Question No: 78 (Marks:1) Vu-Topper RM


While analyzing Selection algorithm, we make a number of passes, in
fact it could be as many as
A. n(n+1)
B. log(n) Page 37

For More Help Contact What’s app 03224021365


C. n/3
D. n/4

Question No: 79 (Marks:1) Vu-Topper RM


In Random Access Machine (RAM), instructions are executed in
A. Parallel
B. Batch
C. One by One Page 10
D. Multiple times

Question No: 80 (Marks:1) Vu-Topper RM


In selection problem, the rank of an element will be its _____ position
A. First
B. final Page 34
C. Second last
D. Last

Question No: 81 (Marks:1) Vu-Topper RM


The worst-case running time of Merge sort is _____ in order to sort an
array of n elements.
A. O(log n)
B. O(n)
C. O(n log n) Page 40
D. O(n)

Question No: 82 (Marks:1) Vu-Topper RM


f(n) and g(n) are asymptotically equivalent. This means that they have
essentially the same ______.
A. Size
B. Results
C. Variables
D. Growth Rates

Question No: 83 (Marks:1) Vu-Topper RM


An algorithm is a mathematical entity. Which is independent of ____.
A. Programming language
B. Machine and Programming language
C. Compiler and Programming language
D. Programing Language Compiler and Machine

Question No: 84 (Marks:1) Vu-Topper RM


In Quick sort algorithm, Pivots form ___
A. Stack
B. Queue
C. Graph

For More Help Contact What’s app 03224021365


D. Binary Search Tree

Question No: 85 (Marks:1) Vu-Topper RM


Counting sort is suitable for sorting the elements within range 1 to P.
where
A. P is large
B. P is Small
C. P is very large
D. P is undetermined

Question No: 86 (Marks:1) Vu-Topper RM


In asymptotical analysis of n'(5 2)-3, as n becomes large, the dominant
(fastest growing) term is some constant times
A. n_1
B. n
C. n+1
D. n*n p-23

Question No: 87 (Marks:1) Vu-Topper RM


___ Items are not allowed in the 0/1 knapsack.
A. Lighter
B. Whole
C. Weighty
D. Fractional

Question No: 88 (Marks:1) Vu-Topper RM


In partition algorithm, the subarray ______ has elements which are
greater than pivot element x.
A. A[q]
B. A[p…r]
C. A[p…q-1]
D. S[q+1…r]

Question No: 89 (Marks:1) Vu-Topper RM


In Heap Sort algorithm, if heap property is violated
A. We ignore
B. We call Heapify procedure
C. We call Build Heap procedure
D. Heap property can never be violated

Question No: 90 (Marks:1) Vu-Topper RM


______ is not a characteristic of Random Access Machine.
A. Assigning a value to a variable
B. Locality of reference
C. Single-Processor Page 10

For More Help Contact What’s app 03224021365


D. Executing an arithmetic instruction

Question No: 91 (Marks:1) Vu-Topper RM


The only way to convert an empty string into a sting of j characters is
by doing j insertions, represented as ______
A. E(i,j) = 1
B. E(I,0) = I
C. E(0,j) = j Page 78
D. E(1,j)= j

Question No: 92 (Marks:1) Vu-Topper RM


In Selection problem, the Sieve technique works in __________.
A. Non-recursive manner
B. Constant time
C. Phases Page 34
D. One complete go

Question No: 93 (Marks:1) Vu-Topper RM


Algorithm is a sequence of computational steps that —- the input into
output.
A. Merge
B. Assign
C. Transform Page 7
D. Integrate

Question No: 94 (Marks:1) Vu-Topper RM


If pj dominates pi and pi dominates ph then pj also dominates ph, it
means dominance relation is
A. Transitive Page 18
B. Non Transitive
C. Equation
D. Symbolic

Question No: 95 (Marks:1) Vu-Topper RM


To find maximal points in brute-force algorithm each point of the space
is compared against ______ of that space.
A. One other point
B. All other points Page 11
C. Few other points
D. Most of the other points

Question No: 96 (Marks:1) Vu-Topper RM


In the following code the statement “cout<<j;”executes ——— times.
for (j=1; j<=5; j = j+2)
cout<<j;

For More Help Contact What’s app 03224021365


A. 5 times
B. 2 times
C. 3 times
D. 0 times

Question No: 97 (Marks:1) Vu-Topper RM


In merge sort algorithm, we split the array around the ______ index q.
A. Mid Page 17
B. Exiting
C. Entring
D. Summing

Question No: 98 (Marks:1) Vu-Topper RM


In Selection problem, the Sieve technique _________.
A. Add some more input items each time
B. Do not work recursively
C. Do not uses Divide and Conquer approach
D. Eliminates undesired data items each time

Question No: 99 (Marks:1) Vu-Topper RM


Consider three matrices X, Y, Z of dimensions 1 x 2, 2 x 3, 3 x 4
respectively. The number of multiplications of X(YZ) is .
A. 16
B. 32 Page 84
C. 32
D. 26

Question No:100 (Marks:1) Vu-Topper RM


In Heap Sort algorithm, the total running time for Heapify procedure is_
A. Theta (log n)
B. Order (log n)
C. Omega (log n)
D. O(1) i.e. Constant time

Question No:101 (Marks:1) Vu-Topper RM


The sieve technique works where we have to find_______ items(s)
from a large input.
A. Single Page 34
B. Two
C. Three
D. Similar

Question No:102 (Marks:1) Vu-Topper RM


In Dynamic Programming based solution of Knapsack Problem, if we
decide to take an object i , then we gain______

For More Help Contact What’s app 03224021365


A. W(Total Weight of Knapsack)
B. V (Total Value of all items)
C. vi (Value of object i) Page 93
D. None of the given option

Question No:103 (Marks:1) Vu-Topper RM


While Sorting, the order domain means for any two input elements x
and y__ satisfies only.
A. x < y Page 39
B. x > y
C. x = y
D. All of the above

Question No:104 (Marks:1) Vu-Topper RM


For solving Selection problem, we introduced Sieve technique due to__
A. Using Decrease and Conquer strategy Page 34
B. Avoiding to sort all input data
C. Eliminating Rank of an element
D. Using Brute-force approach

Question No:105 (Marks:1) Vu-Topper RM


For solving Selection problem, we introduced Sieve technique due to__
A. Using Decrease and Conquer strategy Page 34
B. Avoiding to sort all input data
C. Eliminating Rank of an element
D. Using Brute-force approach

Question No:106 (Marks:1) Vu-Topper RM


In plane sweep approach, a vertical line is swept across the 2d-plane
from_____.
A. Right to Left
B. Left to Right Page 18
C. Top to Bottom
D. Bottom to top

Question No:107 (Marks:1) Vu-Topper RM


For _________ values of n, any algorithm is fast enough.
A. Medium
B. Large
C. Small Page 14
D. Infinity

Question No:108 (Marks:1) Vu-Topper RM


Dynamic programming comprises of _______.
A. Recursion only

For More Help Contact What’s app 03224021365


B. Repetition only
C. Recursion with Repetition
D. No Repetition but Recursion Page 75

Question No:109 (Marks:1) Vu-Topper RM


The function f(n)=n(logn+1)/2 is asymptotically equalient t nlogn :
Here Lower Bound means function f(n) grows asymptotically at __ as
fast as nlog n.
A. Least Page 23
B. Normal
C. Most
D. AT

Question No:110 (Marks:1) Vu-Topper RM


Counting sort has time complexity.
A. O(n+k)
B. O(n) Page 58
C. O(k)
D. O(nlogn)

Question No:111 (Marks:1) Vu-Topper RM


Due to left complete nature of binary tree, the heap can be stored in
A. Array Page 40
B. Structures
C. Link List
D. Stack

Question No:112 (Marks:1) Vu-Topper RM


Single item from a larger set of ________.
A. Constant
B. Pointers
C. Phases
D. n items Page 34

Question No:113 (Marks:1) Vu-Topper RM


In the clique cover problem, for two vertices to be in the same group,
they must be ______ each other.
A. Apart from
B. Far from
C. Near to
D. Adjacent to Page 76

Question No:114 (Marks:1) Vu-Topper RM


How much time merge sort takes for an array of numbers?
A. T(n^2)

For More Help Contact What’s app 03224021365


B. T(n)
C. T(log n)
D. T(n log n) Page 40

Question No:115 (Marks:1) Vu-Topper RM


In in-place sorting algorithm is one that uses arrays for storage.
A. No additional array Page 54
B. An additional array
C. Both of above may be true according to algorithm
D. More than 3 arrays of one dimension

Question No:116 (Marks:1) Vu-Topper RM


Brute-force algorithm for 2D-Maxima is operated by comparing ______
pairs of points.
A. Two
B. Some
C. Most
D. All Page 18

Question No:117 (Marks:1) Vu-Topper RM


While Sorting, the ordered domain means for any two input elements x
and y ____ satisfies only.
A. x > y
B. x < y
C. x = y
D. All of the above Page 38

Question No:118 (Marks:1) Vu-Topper RM


Quick sort is.
A. Not stable but in place Page 54
B. Stable but not in place
C. Stable & in Place
D. Some time stable & some times in place

Question No:119 (Marks:1) Vu-Topper RM


Which may be a stable sort?
A. Merger
B. Insertion
C. Both above Page 54
D. None of the above

Question No:120 (Marks:1) Vu-Topper RM


For the Sieve Technique we take time.
A. T(nk) Page 34
B. IT(n / 3)

For More Help Contact What’s app 03224021365


C. n^2
D. n/

Question No:121 (Marks:1) Vu-Topper RM


Continuation sort is suitable to sort the elements in range 1 to k.
A. K is Large
B. K is not known
C. K may be small or large
D. K is small Page 54

Question No:122 (Marks:1) Vu-Topper RM


Asymptotic growth rate of the function is taken over ______ case
running time. .
A. Worst Page 14
B. Average
C. Best
D. Normal

Question No:123 (Marks:1) Vu-Topper RM


Before sweeping a vertical line in plane sweep approach, in start sorting
of the points is done in increasing order of their _____ coordinates. .
A. Y
B. Z
C. X
D. X , Y

Question No:124 (Marks:1) Vu-Topper RM


In Quick sort, we don’t have the control over the sizes of recursive
calls.
A. True Page 49
B. False
C. Less information to decide
D. Ether true or false

Question No:125 (Marks:1) Vu-Topper RM


Random access machine or RAM is a/an.
A. Machine build by Al-Khwarizmi
B. Mechanical machine
C. Mathematical model Page 10
D. Electronics machine

Question No:126 (Marks:1) Vu-Topper RM


A heap is a left-complete binary tree that confirms to the ________.
A. increasing order only
B. decreasing order only

For More Help Contact What’s app 03224021365


C. heap order Page 40
D. log n order

Question No:127 (Marks:1) Vu-Topper RM


Which one of the following sorting algorithms is the fastest?
A. Merge sort
B. Quick sort
C. Insertion sort
D. Heap sort

Question No:128 (Marks:1) Vu-Topper RM


Quick sort algorithm divide the entire array into ________ sub arrays.
A. 2
B. 3
C. 4
D. 5

Question No:129 (Marks:1) Vu-Topper RM


In brute force algorithm, we measure running time T(n) based on ____.
A. Worst-case time and best-case time
B. Worst-case time and average-case time Page 46
C. Average-case time and best-case time
D. Best-case time and staring-case time

Question No:130 (Marks:1) Vu-Topper RM


algorithm first of all _______.
A. Sorts all points
B. Delete some points
C. Output the elements
D. Pushes all points on stack

Question No:131 (Marks:1) Vu-Topper RM


Which symbol is used for Omega notation?
A. (O)
B. (ϴ)
C. (Ω)
D. (@)

Question No:132 (Marks:1) Vu-Topper RM


Selection sort is a ______ sorting algorithm
A. In-place Page 54
B. Not In-Place
C. Stable
D. in-partition

For More Help Contact What’s app 03224021365


Question No:133 (Marks:1) Vu-Topper RM
We do not need to prove comparison-based sorting algorithms by
mathematically. It always takes _________ time.
A. Big Oh nlog(n)
B. Omega nlog(n)
C. Omega n(n^2)
D. Theta nlog(n)

Question No:134 (Marks:1) Vu-Topper RM


Merge sort is a/an _______ and ________ sorting algorithm
A. Not in-place, not stable one
B. In-place, not stable one
C. In-place, stable one
D. Not in-place, stable one Page 54

Question No:135 (Marks:1) Vu-Topper RM


Cubic function will ________ a quadratic function.
A. Prove
B. Be equal to
C. Overtake Page 25
D. Find

Question No:136 (Marks:1) Vu-Topper RM


Insertion sort is a _________ sorting algorithm
A. Unstable
B. In-place Page 54
C. Not In-Place
D. in-partition

Question No:137 (Marks:1) Vu-Topper RM


To check whether a function grows faster or slower than the other
function, we use some asymptotic notations, which is ________.
A. Big-oh notation
B. Theta notation
C. Omega notation
D. All of the given

Question No:138 (Marks:1) Vu-Topper RM


Asymptotic growth of 8n^2 + 2n – 3 is:
A. Θ(n^2 + n)
B. Θ (n^2) Page 14
C. Θ(8n^2)
D. Θ(8n^2 + 2n)

For More Help Contact What’s app 03224021365


Question No:139 (Marks:1) Vu-Topper RM
In the analysis of algorithms, _________ plays an important role.
A. Time
B. Money
C. Growth rate
D. Text analysis

Question No:140 (Marks:1) Vu-Topper RM


In inductive approach of knapsack problem, we consider 2 cases, ____
Or ________.
A. Median, Mode
B. Recursive, Iterative
C. Leave object, Take object Page 93
D. Sequentially. Parallel

Question No:141 (Marks:1) Vu-Topper RM


Random Access Machine (RAM) can execute _________ instructions
A. Parallel
B. Only logical
C. Only arithmetic
D. Logical and arithmetic

Question No:142 (Marks:1) Vu-Topper RM


Using _______ algorithm, efficiency is not given much importance
A. Greedy
B. Merge sort
C. Processing
D. Brute Force

Question No:143 (Marks:1) Vu-Topper RM


Bubble sort takes theta _________ in the worst case
A. (n2) Page 39
B. (n)
C. log(n)
D. nlog(n)

Question No:144 (Marks:1) Vu-Topper RM


If matrix A of dimension p × q is multiply with matrix B of dimension q
× r, then dimension of resultant matrix is:
A. q × r
B. r × p
C. P x r
D. P x q

For More Help Contact What’s app 03224021365


Question No:145 (Marks:1) Vu-Topper RM
Dynamic Programing algorithms often use some kind of ________ to
store the results of intermediate sub-problems
A. Stack
B. Loop
C. Table
D. variable

Question No:146 (Marks:1) Vu-Topper RM


________________ is in-place sorting algorithm.
A. Bubble sort Page 54
B. Merge sort
C. Linear search
D. Binary Search

Question No:147 (Marks:1) Vu-Topper RM


Which one of the following problems can be solved using dynamic
problem?
A. Bubble sort problem
B. Greedy search problem
C. Fractional knapsack problem
D. Matrix chain multiplication problem Page 85

Question No:148 (Marks:1) Vu-Topper RM


In chain matrix multiplication, solutions of the sub-problems are stored
in a_________.
A. Array
B. Table Page 86
C. Tree
D. Link list

Question No:149 (Marks:1) Vu-Topper RM


What is the average running time of a quick sort algorithm?
A. O(n^2)
B. O(n)
C. O(n log n) Page 49
D. O(log n)

Question No:150 (Marks:1) Vu-Topper RM


Sorting Algorithms having O _______ running time are considered to
be slow ones.
A. (n)
B. (n^2) Page 39
C. (nlog(n))
D. (log(n))

For More Help Contact What’s app 03224021365


Question No:151 (Marks:1) Vu-Topper RM
While solving Selection problem, in Sieve technique we partition input
data________
A. Randomly
B. According to Pivot
C. In increasing order
D. In decreasing order

Question No:152 (Marks:1) Vu-Topper RM


________ is the process of avoiding unnecessary repetitions by writing
down the results of recursive calls and looking them up again if we
need them later.
A. Loop
B. Function
C. Recursion
D. Memoization Page 74

Question No:153 (Marks:1) Vu-Topper RM


In average-case time the probability of seeing input is denoted by ____.
A. p{I}
B. p[I]
C. p<i>
D. p(i) Page 13

Question No:154 (Marks:1) Vu-Topper RM


While applying the Sieve technique to selection sort, how to choose a
pivot element.
A. Through mean
B. Linear
C. Randomly Page 35
D. Sequentially

Question No:155 (Marks:1) Vu-Topper RM


Number of _______ of the pseudo code are counted to measure the
running time.
A. Inputs
B. Outputs
C. Steps Page 13
D. Pages

Question No:156 (Marks:1) Vu-Topper RM


Developing a dynamic programming algorithm generally involves
______separate steps.
A. One
B. Two Page 75

For More Help Contact What’s app 03224021365


C. Three
D. Four

Question No:157 (Marks:1) Vu-Topper RM


8n^2+2n+3 will exceed c28(n), no matter how large we make _____.
A. n
B. 2n
C. c2 Page 25
D. this quadratic equation

Question No:158 (Marks:1) Vu-Topper RM


The running time of quick sort algorithm_________.
A. Is impossible to compute
B. Has nothing to do with pivot selection
C. Is Random upon each execution
D. Greatly influenced by the selection of pivot Page 49

Question No:159 (Marks:1) Vu-Topper RM


_________ involves breaking up the problem into sub problems whose
solutions can be combined to solve the global problem.
A. Complexity Theory
B. Greedy Algorithms
C. Divide and Conquer Strategy Page 34
D. Dynamic programming solution

Question No:160 (Marks:1) Vu-Topper RM


In __________ we have to find rank of an element from given input.
A. Merge sort algorithm
B. Selection problem Page 34
C. Brute force technique
D. Plane Sweep algorithm

Question No:161 (Marks:1) Vu-Topper RM


How many steps are involved to design the dynamic programming
strategy?
A. 2
B. 4 Page 92
C. 3
D. 1

Question No:162 (Marks:1) Vu-Topper RM


In Bucket sort, if there are duplicates then each bin can be replaced by a
Stack
A. Heap
B. Hash table

For More Help Contact What’s app 03224021365


C. Linked list Page 69

Question No:163 (Marks:1) Vu-Topper RM


In merge sort algorithm, we split the array ______ to find index q.
A. from end
B. from start
C. midway Page 28
D. both from start or end

Question No:164 (Marks:1) Vu-Topper RM


Find the maximum value of the items which can carry using knapsack
Knapsack weight capacity = 50.
Item Weight Value
11070
22020
33080
470 200

A. 90
B. 280
C. 200
D. 100

Question No:165 (Marks:1) Vu-Topper RM


In 2-d maxima problem a point p is said to be dominated by point q if_.
A. p.x<= q.x
B. bp.x<= q.x and p.y<= q.y Page 17
C. p.y<= q.y
D. p.x>= q.x and p.y>=q.y

Question No:166 (Marks:1) Vu-Topper RM


Sorting can be in ______________.
A. Increasing order only
B. Decreasing order only
C. Both increasing and decreasing order
D. Random order

Question No:167 (Marks:1) Vu-Topper RM


Recurrence can be described in terms of _______________.
A. Array
B. Linear
C. Tree Page 31
D. Graph

For More Help Contact What’s app 03224021365


Question No:168 (Marks:1) Vu-Topper RM
The brute-force algorithm for 2D-Maxima runs in order O(__) time.
A. n
B. n(log n)
C. n*n Page 18
D. n3

Question No:169 (Marks:1) Vu-Topper RM


In plane sweep approach of solving geometric problems, a _________
is swept across the plane.
A. Line Page 18
B. Plane
C. Cube
D. Box

Question No:170 (Marks:1) Vu-Topper RM


Which of the following is calculated with Big Omega notation?
A. Upper bounds
B. Lower bounds Page 25
C. Medium bounds

Question No:171 (Marks:1) Vu-Topper RM


_________ is always based on divide and conquer strategy.
A. Bubble sort
B. Selection sort
C. Pigeon sort
D. Quick sort Page 46

Question No:172 (Marks:1) Vu-Topper RM


If a matrix has three rows and two columns, then dimensions of matrix
will be:
A. 3×2
B. 2×3
C. 3×3
D. 2×2

Question No:173 (Marks:1) Vu-Topper RM


Asymptotic notations are used to describe _______ of an algorithm.
A. Size
B. Length
C. Running time Google
D. Compile time

For More Help Contact What’s app 03224021365


Question No:174 (Marks:1) Vu-Topper RM
Catalan numbers are related the number of different ____ on ‘n’ nodes.
A. Arrays
B. linked lists
C. binary trees Page 85
D. functions

Question No:175 (Marks:1) Vu-Topper RM


Applying the sieve technique to selection problem, ________ element
is picked from array.
A. Pivot Page 35
B. Total
C. Input
D. Output

Question No:176 (Marks:1) Vu-Topper RM


In recursive formulation of knapsack Problem: V [0, j] = ____ for j>=0
A. 2
B. -1 Page 93
C. 1
D. 2

Question No:177 (Marks:1) Vu-Topper RM


________ is a linear time sorting algorithm.
A. Merge sort
B. Radix sort Page 71
C. Quick sort
D. Bubble sort

Question No:178 (Marks:1) Vu-Topper RM


Quick sort is one of the _____ sorting algorithm.
A. Fastest Page 19
B. Slowest
C. Major
D. Average

Question No:179 (Marks:1) Vu-Topper RM


The time assumed for each basic operation to execute on RAM model
of computation is _____.
A. Infinite
B. Continuous
C. Constant Page 10
D. Variable

For More Help Contact What’s app 03224021365


Question No:180 (Marks:1) Vu-Topper RM
While analyzing algorithms, _______ and _______ usually considered
difficult to calculate.
A. Floor, ceiling Google
B. Row, Column
C. Finite, Infinite
D. Graph, Tree

Question No:181 (Marks:1) Vu-Topper RM


While analysis of the brute-force maxima algorithm, an array sorted in
the reverse order is the type of _________ case input.
A. Best
B. Worst Page 14
C. Somewhat bad
D. Average

Question No:182 (Marks:1) Vu-Topper RM


_________ is not useful measure of central tendency of given input set
especially when the distribution of values is highly skewed.
A. Mean
B. Mode
C. Average
D. Median Page 34

Question No:183 (Marks:1) Vu-Topper RM


In asymptotical analysis of n(n-3) and 4n*n, as n becomes large, the
dominant (fastest growing) term is some constant times _______.
A. n+1
B. n-1
C. n
D. n*n Page 23

Question No:184 (Marks:1) Vu-Topper RM


In addition to passing in the array itself to Merge Sort algorithm, we
will pass in other arguments which are indices.
A. Three
B. Two
C. Four
D. Five

Question No:185 (Marks:1) Vu-Topper RM


In 2d-maximal problem, a point is said to be if it is not dominated by
any other point in that space.
A. Member
B. Minimal

For More Help Contact What’s app 03224021365


C. Maximal
D. Joint

Question No:186 (Marks:1) Vu-Topper RM


Counting sort assumes that the numbers to be sorted are in the range__.
A. K to n where n is large
B. K to n where k is small
C. 1 to k where k is small
D. k to n where n is small

Question No:187 (Marks:1) Vu-Topper RM


Insertion sort is an efficient algorithm for sorting a _________ number
of elements
A. Small
B. Large
C. Extra large
D. Medium

Question No:188 (Marks:1) Vu-Topper RM


If the indices passed to merge sort algorithm are _________ then this
means that there is only one element to sort.
A. Small Page 28
B. Large
C. Equal
D. Not Equal

Question No:189 (Marks:1) Vu-Topper RM


In Knapsack Problem, each item must be entirely accepted or rejected,
is called ______ problem.
A. Linear
B. Fractional
C. 0-1
D. Optimal

Question No:190 (Marks:1) Vu-Topper RM


If the time complexity of an algorithm is O(n). then it is called _______
time complexity.
A. Linear
B. Constant
C. Average
D. Exponential

Question No:191 (Marks:1) Vu-Topper RM


In the case of _____ analysis does not depend upon on the distribution
of input.

For More Help Contact What’s app 03224021365


A. Merge sort
B. Insertion sort
C. Quick Sort
D. Heap sort

Question No:192 (Marks:1) Vu-Topper RM


We can use the ___________ Property to devise a recursive formulation
of the edit distance problem.
A. Small substructure
B. Algorithmic
C. Real
D. Optimal substructure Page 78

Question No:193 (Marks:1) Vu-Topper RM


The following sequence is called ____________
1,2,3,5,8,13,21,34,55,…..
A. Fibonacci sequence Page 73
B. Optimal sequence
C. Optimize Sequence
D. Overlapping sequence

Question No:194 (Marks:1) Vu-Topper RM


Which one sorting algorithm is best suited to sort an array of 2 million
elements?
A. Insert sort
B. Ridx Sort Page 71
C. Merge sort
D. Quick sort

Question No:195 (Marks:1) Vu-Topper RM


We can improve the performance of quick sort if we could be able to_.
A. Select two or more pivots Page 34
B. Skip any sub-array completely
C. Skit Input elements somehow
D. Eliminate recursive calls

Question No:196 (Marks:1) Vu-Topper RM


The problem with the brute-force algorithm is that is uses ________ in
pruning out de
A. Worst-case time
B. No intelligence Page 18
C. Outside looping
D. Artificial intelligence

For More Help Contact What’s app 03224021365


Question No:197 (Marks:1) Vu-Topper RM
In Heap Sort algorithm. Heapify procedure is ________ in nature.
A. Recursive
B. Non-Recursive Page 43
C. Fast
D. Slow

Question No:198 (Marks:1) Vu-Topper RM


An algorithm is said to be correct if for every ______ instance, it halts
with the correct ______.
A. Input, Output Page 13
B. Design, Analysis
C. Value, Key
D. Key, Analysis

Question No:199 (Marks:1) Vu-Topper RM


If we have an equation 8n2+7f*n + 5f + 6 then is large, ________ term
will be muchxxxxxxxthe n term and will dominate the running time.
A. f g (n)
B. g (n) * 2
C. n * 2 Page 23
D. f (n)

Question No:200 (Marks:1) Vu-Topper RM


For quick sort algorithm. Partitioning takes theta ________.
A. (n)
B. log(n)
C. n log (n)
D. n2log (n)

Question No:201 (Marks:1) Vu-Topper RM


In Heap Sort algorithm, the maximum levels an element can move
upward is_______
A. Theta (log n) Page 43
B. Big-ch (log n)
C. Omega (log n)
D. 0 (1) i.e. Constant time

Question No:202 (Marks:1) Vu-Topper RM


Which process is used for avoiding unnecessary repetitions and looking
them up again if we need them later.
A. Greedy Approach
B. Memoization Page 74
C. Divide and conquer
D. Recursion

For More Help Contact What’s app 03224021365


Question No:203 (Marks:1) Vu-Topper RM
The worst-case running time of Quick sort is _________ in order to sort
an array of n element.
A. O(n log n) Page 49
B. O(n)
C. O(n2)
D. O(log n)

Question No:204 (Marks:1) Vu-Topper RM


Boolean operation is a _________ operation on an idealized RAM
model of computation.
A. Advance
B. String
C. Basic
D. Normal

Question No:205 (Marks:1) Vu-Topper RM


In chain matrix multiplication, if there are n items, there are ________
ways in which outer most pair of parentheses can placed.
A. n^2
B. 2n
C. n+1
D. n-1 Page 85

Question No:206 (Marks:1) Vu-Topper RM


The number of nodes in a complete binary tree of height h is:
A. (h+1) – 1
B. (h+1)
C. 2^(h+1) – 1 Page 40
D. ((h+1)^2) – 1

Question No:207 (Marks:1) Vu-Topper RM


In Sieve Technique, we know the item of interest.
A. True
B. False

Question No:208 (Marks:1) Vu-Topper RM


The Huffman codes provide a method of encoding data inefficiently
when coded using ASCII standard.
A. True
B. False Page 99

For More Help Contact What’s app 03224021365


Question No:209 (Marks:1) Vu-Topper RM
In Heap Sort algorithm, we build _____ for ascending sort.
A. Min heap
B. Max Heap Page 41
C. Both
D. None of these

Question No:210 (Marks:1) Vu-Topper RM


Quick sort is a recursive algorithm.
A. True
B. False

For More Help Contact What’s app 03224021365

You might also like