DAA_MID-1
DAA_MID-1
_________refers to the task of determining how much computing time and storage an B
algorithm requires
A Validate Algorithms B Analyze algorithms
C Devise Algorithms D Test Algorithms
002. Which of the following condition belongs to termination of an algorithm after a limited B
number of steps
A Definiteness B Finiteness
C Infiniteness D Effectiveness
003. Which of the following not a criteria for all types of algorithms. C
A Definiteness B Finiteness
C Infiniteness D Effectiveness
004. The purpose of the _______________is to assures that this algorithm will work D
correctly independently of the issues concerning the programming language it will
eventually be written in.
A Performance analysis B Debugging
C Deploying D Validation
005. ______is the process of executing programs on sample data sets to determine whether A
faulty results occur and, if so, to correct them
A Debugging B Profiling
C Validation D program proving
006. The measure of the longest amount of time possibly taken to complete an algorithm is D
expressed as __.
A Little-O B Little-Omega
C Big-Omega D Big-O
007. Find the value returned by the following AB algorithm Algorithm AB(A, n)//A is an array A
of size n { Result:=A[1]; for i :=2 to n do if A[i] >Result then Result:=A[i];return Result;}
A returns the maximum of n given B returns the minimum of n given
numbers numbers
C returns the average of n given D returns the sum of n given numbers
numbers
008. The following statement comes under ________type of category a:=a + b*e; C
A Declaration of variables B Loop statement
C Assignment of expression D Conditions statements
009. In algorithm specification blocks are indicated with ____braces D
A Parenthesis braces() B Square braces[]
C angular braces<> D Matching braces{}
010. The following example comes under _______data type node= record {Datatype1: A
data1; Datatype2data2; node *link; }
A Compound B Derived
C Simple D Ternary
011. The _______of an algorithm is the amount of computer time it needs to run to B
completion
A Space Complexity B Time complexity
C Factor Complexity D Eigen complexity
012. The amortized complexity to perform insert, delete, and search operations in splay B
trees is
A O(n^3) B O(logn)
C O(n^2) D O(n)
013. ___ is defined as a set of well-defined instructions used to accomplish a particular task. A
a
A Algorithm B Function
C Program D Procedure
014. _________ is a complexity of an algorithm is the amount of memory it needs to run to A
completion
A Space Complexity B Time complexity
C Factor Complexity D Eigen complexity
015. O(1) to mean a computing time is B
A Linear B Constant
C Exponential D Cubic
016. Potential function method is the technique that performs an amortized analysis based D
on ___.
A Financial model B Computational model
C Algorithm analysis D Energy model
017. Consider the experiment of throwing three coins, how many possible outcomes will C
occur
A 2 B 6
C 8 D 10
018. m
If f(n)=amn +a1n+a0,then f(n)=O(___) C
A O(n) B O(m)
C m
O(n ) D O(mn)
019. Which of the following is not a method to arrive at amortized costs for operations are C
A Aggregate Method B Potential Method
C Actual Cost Method D Accounting Method
020. The only requirement is that the sum of the amortized complexities of all operations in B
any sequence of operations be ___________to their sum of the actual complexities
A Less than or equal to B Greater than or equal to
C Less than D Greater than
021. Which of the following is not an algorithmic approach D
A Dynamic Programming B Greedy Approach
C Divide and Conquer D 0/1 knapsack
022. O(n) is_______ D
A linear complexity B factorial complexity
C exponential time D Polynomial complexity
023. ___ within the limit deals with the behavior of a function for sufficiently large values of A
its parameter.
A Asymptotic notation B Big-Oh notation
C Omega notation D Theta notation
024. _____ is the maximum amount of time an algorithm takes to execute a specific set of C
inputs.
A Running time B Average case time complexity
C Worst case time complexity D Best case time complexity
025. An algorithm that uses random numbers to decide what to do next anywhere in its logic D
is called ___________
A Dynamic approach B Greedy approach
C Dynamic Programming D Randomized Algorithm
026. ______________ presents the upper and the lower bound of the running time of an A
algorithm
A Theta Notation (-notation) B Omega Notation (-notation)
C Big-O Notation (O-notation) D Asymptotic notation
027. Two events E1 and E2 are said to be mutual exclusive if and only if _________ existed A
A No common sample points B common sample points
C Equal sample points D At least one sample point
028. A ___ is a compact, informal, and environment-independent description of a computer C
programming algorithm.
A Stack B Queue
C Psuedocode D Non-linear data structure
029. O(X) is___________ C
A linear complexity B factorial complexity
C exponential time D Polynomial complexity
030. Towers of Hanoiis a famous problem that has a recursive solution running in C
A O(n )3 B 2
O(n )
n
C O(2 ) D O(n2)
031. Flip a coin four times and then the sample space consists of_____sample points A
A 16 B 8
C 12 D 24
032. (log n) is? B
A constant asymptotic notations B logarithmic asymptotic notations
C polynomial asymptotic notations D quadratic asymptotic notations
033. The probability of the sum of two faces (six faced dice) is 10 C
A 1/36 B 2/36
C 3/36 D 10/36
034. Tossing three coins, The probability of the event {HHT,HTT,TTT} is______ B
A 0.1245 B 0.25
C 0.375 D 0.5
035. The number of possible outcomes generated by rolling two (six-faced) dice D
A 6 B 12
C 24 D 36
036. Worst Case indicates maximum time required for program execution. A
A Yes B No
C Can be yes or no D Can not say
037. Asymptotic analysis is _______ bound. B
A Output B Input
C Outer D inner
038. ___________ is linear asymptotic notations? C
A (1) B (log n)
C (n) D (n log n)
039. The Theta notation is the formal way to express ____________ of an algorithm 's C
running time.
A upper bound B lower bound
C lower bound and upper bound D None of the above
040. _________case indicates the minimum time required for program execution. A
A best case B average case
C worst case D None of the above
041. _________ analysis, the time of the algorithm is found prior to implementation and time B
is not in terms of any such time units. Instead, it represents the number of operations
that are carried out while executing the algorithm.
A Posteriori analysis B Priori analysis
C Asymptotic analysis D Symptotic analysis
042. In _______ analysis, algorithm is implemented and executed on certain fixed hardware A
and software. Then the algorithm is selected which takes the least amount of time to
execute.
A Posteriori analysis B Priori analysis
C Asymptotic analysis D Symptotic analysis
043. Thetotal amortized costof insertion in the Red-Black Tree is________. B
A O(1) B O(N)
C O(logN) D O(NlogN)
044. ____________of an algorithm refers to defining the mathematical foundation/framing of B
its run-time performance.
A Symptotic analysis B Asymptotic analysis
C PosteriorAnalysis D PrioriAnalysis
045. ________is the time complexity in decreasing the node value in a binomial heap. C
A O(1) B O(N)
C O(logN) D O(NlogN)
046. O(nlogn) is known as C
A linear complexity B logarithmic complexity
C loglinear complexity D constant complexity
047. Divide and Conquer principle is naturally expressed by B
A Non Recursive algorithm B Recursive algorithm
C Iterations D Object Oriented
048. Find the order of best case time complexities D
A O(n),O(1),O(logn),O(n logn) B O(1),O(logn),O(n logn),O(n)
C O(logn),O(n logn),O(n),O(1) D O(1), O(logn),O(n),O(nlogn)
049. ________ types of asymptotic notations existed in analyzing algorithms C
A 1 B 2
C 3 D 4
050. _________of the following is case does not exist in time complexity D
A Best Case B Worst Case
C Average Case D Null Case
051. k* k
A defective chessboard is a 2 2 board of squares with _____defective sqaure A
A Exactly one defective square B Exactly two defective squares
C Exactly three defective squares D Any number of defective squares
052. In the defective chess board problem, are required to tile a defective chessboard using C
_______
A triangle B Square
C Triominoes D orientations
053. Time Complexity of Binary Search Algorithm for unsuccessful searches in the C
approach of divide and conquer
A O(n) B O(n log2n)
C O(log2n). D O(n^2log2n)
054. Best case complexity for successful searches in binary search tree using divide and B
conquer approach
A O(n) B O(1)
C O(logn) D O(nlogn)
055. The following recurrence relation using recursion tree method shows that T(n) = A
2T(n/2) + n
A A problem of size n will get divided B A problem of size n will get divided
into 2 sub-problems of size n/2 . into 2 sub-problems of size n.
C A problem of size n/2 will get divided D A problem of size n/4 will get divided
into 2 sub-problems of size n into 2 sub-problems of size n
056. The auxiliary space complexity of merge sort_____ C
A O(1) B O(log n)
C O(n) D O(n log n)
057. Choose the correct code for merge sort. B
A B
C D
058. The average case time complexity of merge sort A
A O(n log n) B O(n2)
C O(n2log n) D O(n log n2)
059. The following recurrence relation using recursion tree method shows that T(n) = T(n/5) A
+ T(4n/5) + n
A A problem of size n will get divided B A problem of size n will get divided
into 2 sub-problems- one of size n/5 into 2 sub-problems- one of size n/5
and another of size 4n/5. and another of size n.
C A problem of size n will get divided D A problem of size n will get divided
into 2 sub-problems- one of size 4n into 2 sub-problems- one of size 4n/5
and another of size 4n/5 and another of size n
060. Merge sort uses which of the following technique to implement sorting? C
A backtracking B greedy algorithm
C divide and conquer D dynamic programming
061. Which of the below-given sorting techniques has the highest best-case runtime B
complexity.
A Quick sort B Selection sort
C Insertion sort D Bubble sort
062. A sorting technique is called stable if: B
A It takes O(n log n) time. B It maintains the relativeorder of
occurrence of the same elements.
C It uses a divide andconquer D It takes O(n) space.
approach.
063. In quick sort, for sorting n elements, we choose the n/4thsmallest element as a pivot B
with an O(n) time algorithm. What is the worst-case time complexity for the quick sort
A (n) B (n log n)
C 2
(n ) D (n2log n)
064. _________is the worst case time complexity of a quick sort algorithm? C
A O(N) B O(N log N)
C O(N2) D O(log N)
065. _______ pivoting improve the expected or average time complexity to O (N log N). D
A First element B last element
C middle element D random element
066. Which of the following algorithms is NOT a divide & conquer algorithm by nature? D
A Quick Sort B Merge Sort
C Binary Search D Heap Sort
067. More than one feasible solution is generated in__________ approach A
A Greedy B Divide and Conquer
C Dynamic Programming D Iterative
068. What is the worst case complexity of binary search using divide and conquer master B
theorem?
A O(nlogn) B O(logn)
C O(n) D O(n2)
069. Which is the best sorting algorithm to use if the elements in the array are more than C
one million in general?
A Merge sort. B Bubble sort.
C Quick sort. D Insertion sort.
070. What is the average case time complexity of binary search using recursion? B
A O(nlogn) B O(logn)
C O(n) D O(n2)
071. Consider a complete graph G with 4 vertices. The graph G has ____ spanning trees. C
A 15 B 8
C 16 D 13
072. Prims algorithm is ________type of approach B
A Divide and conquer algorithm B Greedy algorithm
C Dynamic Programming D Approximation algorithm
073. Which of the following is false in the case of a spanning tree of a graph G? D
A It is tree that spans G B It is a sub graph of the G
C It includes every vertex of the G D It can be either cyclic
074. An optimal solution is a feasible solution for which is ___-profit A
A maximized B minimized
C equal D zero
075. Consider the following instance of the knapsack problem: n = 3,m= 20,(pi,p2,P3) = B
(25,24,15), and (w,w2,w3)= (18,15,10).Find the optimal solution of maximum profit
A 31 B 31.5
C 32 D 32.5
076. Optimal merge patternis a pattern that relates to the merging of two or more ______ B
files in a single sorted file
A Unsorted files B Sorted files
C binary files D character files
077. If we have two sorted files containing n and m records respectively then they could be A
merged together, to obtain one sorted file in time
A O (n+m). B O (n).
C O(m) D O(mlogn)
078. Let us consider the given files, f1, f2, f3, f4and f5with 20, 30, 10, 5 and 30 number of C
elements respectively. Find the total number of moves required to merge all these files
according to the ascending order.
A 270 B 230
C 210 D 190
079. ________is the worst case time complexity of Prims algorithm if adjacency matrix is B
used?
A O(log V) B O(V2)
C O(E2) D O(V log E)
080. Consider the files x1,x2, x3 with the length of 30,20,and 10 records each. The total A
number of moves required to merge the three files according to the given order
A 110 B 60
C 85 D 120
081. In a knapsack problem, if a set of items are given, each with a weight and a value, the D
goal is to find the number of items that ___ the total weight and ___ the total value.Ans:
A Minimizes, Minimizes B Maximizes, Maximizes
C Maximizes, Minimizes D Minimizes, Maximizes
082. With respect to finding the time complexity of Kruskals algorithm, which operation C
keeps track of the parent pointer until it reaches the root parent?
A Makeset B Union
C Find D Merge
083. In the optimal merge pattern, list(L) is represented as a min-heap. and the value in the D
root is less than or equal to the values of its children ,in this case the time complexity is
A O(n^2) B O(n)
C O(logn) D O (n log n).
084. In the optimal merge pattern the list is kept in increasing order according to the weight A
value in the roots and insertion performed on O(n) then total time complexity is
A O(n^2) B O(n)
C O(logn) D O (n log n).
085. A Huffman code: A = 1, B = 000, C = 001, D = 01, P(A) = 0.4, P(B) = 0.1, P(C) = 0.2, B
P(D) = 0.3 The average number of bits per letter is
A 8.0 bit B 1.9 bit
C 2.0 bit D 2.1 bit
086. Finding maximum and minimum numbers from the given set requires _____no of A
comparisons in the case of divide and conquer approach when n is power of 2
A (3n/2) 2 B 2(n-1)
C n 2 D logn
087. Kruskals Algorithm for finding the Minimum Spanning Tree of a graph is a kind of a? C
A Dynamic programming B Divide and Conquer
C Greedy approach D Adhoc Approach
088. How many printable characters does the ASCII character set consists of? C
A 120 B 128
C 100 D 98
089. __________is an application of binary trees with minimal weighted external path length B
is to obtain an optimal set of codes for messages M1,M2,Mn+1 and each code is
binary string that is used for transmission of the corresponding message.
A A.Single Source shortest path B Huffman coding
C Binary Search tree D Merge Sort
090. The given graphG=(V,E) is represented as an adjacency matrix.w[u, v]stores the B
weight of edge(u, v). The priority queueQ is represented as an unordered list. Let|E|
and |V| be the number of edges and vertices in the graph, respectively. Then the time
complexity is ______
A O(V^3) B O(V^2)
C O(E+V) D O(|E|+|V|*log|V|)
091. Which of the following algorithms is the best approach for solving Huffman codes? B
A exhaustive search B greedy algorithm
C brute force algorithm D divide and conquer algorithm
092. Which of the following is not related to Dijkstras algorithm B
A Dijkstras algorithm works only for B It works for graphs that contain any
connected graphs. edges with positive and negative
weights.
C It only provides the value or cost of D The algorithm works for directed and
the shortest paths. undirected graphs.
093. Straight MaxMin requires ________ element comparisons in the best, average & worst B
cases.
A n2 B 2(n-1)
C n D (3n/2) 2
094. Which of the following is the most commonly used data structure for implementing D
Dijkstras Algorithm?
A Max priority queue B Stack
C Circular queue D Min priority queue
095. Advantage of finding maximum and minimum using divide and conquer method instead C
of using conditional operators is __________________
A Less space complexity B Accuracy
C Reduced Time Complexity D Less number of calculation
096. With respect to finding the time complexity of Kruskals algorithm, which operation C
keeps track of the parent pointer until it reaches the root parent?
A Makeset B Union
C Find D Merge
097. Merge sort is _________type of sorting A
A External Sorting B Insertion Sorting
C Internal Sorting D Exponential Sorting
098. Dijkstras Algorithm is used to solve _____________ problems. B
A All pair shortest path B Single source shortest path
C Network flow D Sorting