CS502-Midterm
1 / 50
Consider the following code:
For(j=1; j
For(k=1; k<15;k++)
For(l=5; l
{
Do_something_constant();
}
What is the order of execution for this code.
2 / 50
Efficient algorithm requires less computational…….
3 / 50
In selection algorithm, because we eliminate a constant fraction of the array with each phase, we get the
4 / 50
The time assumed for each basic operation to execute on RAM model of computation is-----
5 / 50
For Chain Matrix Multiplication we can not use divide and conquer approach because,
6 / 50
What is the solution to the recurrence T(n) = T(n/2)+n .
7 / 50
In Quick Sort Constants hidden in T(n log n) are
8 / 50
In Heap Sort algorithm, we build _______ for ascending sort.
9 / 50
The sieve technique works where we have to find _________ item(s) from a large input.
10 / 50
Divide-and-conquer as breaking the problem into a small number of
11 / 50
For the heap sort we store the tree nodes in
12 / 50
Brute-force algorithm uses no intelligence in pruning out decisions.
13 / 50
In pseudo code, the level of details depends on intended audience of the algorithm.w
14 / 50
Is it possible to sort without making comparisons?
15 / 50
In 2d-space a point is said to be ________if it is not dominated by any other point in that space.
16 / 50
Sieve Technique can be applied to selection problem?
17 / 50
In Sieve Technique we do not know which item is of interest
18 / 50
Sieve Technique applies to problems where we are interested in finding a single item from a larger set of _____________
19 / 50
For small values of n, any algorithm is fast enough. Running time does become an issue when n gets large.
20 / 50
The analysis of Selection algorithm shows the total running time is indeed ________in n,
21 / 50
22 / 50
Upper bound requires that there exist positive constants c2 and n0 such that f(n) ____ c2n for all n <= n0(ye question ghalat lag raha hai mujhae
23 / 50
In addition to passing in the array itself to Merge Sort algorithm, we will pass in _________other arguments which are indices.
24 / 50
The O-notation is used to state only the asymptotic ________bounds.
25 / 50
The function f(n)=n(logn+1)/2 is asymptotically equivalent to nlog n. Here Lower Bound means function f(n) grows asymptotically at ____________ as fast as nlog n.
26 / 50
One example of in place but not stable algorithm is
27 / 50
If the indices passed to merge sort algorithm are ________,then this means that there is only one element to sort.
28 / 50
If there are Θ (n2) entries in edit distance matrix then the total running time is
29 / 50
In analysis, the Lower Bound means the function grows asymptotically at least as fast as its largest term.
30 / 50
Analysis of Selection algorithm ends up with,
31 / 50
______________ graphical representation of algorithm.
32 / 50
In simple brute-force algorithm, we give no thought to efficiency.
33 / 50
For the worst-case running time analysis, the nested loop structure containing one “for” and one “while” loop, might be expressed as a pair of _________nested summations.
34 / 50
In analysis, the Upper Bound means the function grows asymptotically no faster than its largest term.
35 / 50
Brute-force algorithm for 2D-Maxima is operated by comparing ________ pairs of points.
36 / 50
A (an) _________ is a left-complete binary tree that conforms to the heap order
37 / 50
In the analysis of Selection algorithm, we eliminate a constant fraction of the array with each phase; we get the convergent _______________ series in the analysis,
38 / 50
44.The running time of an algorithm would not depend upon the optimization by the compiler but that of an implementation of the algorithm would depend on it.
39 / 50
What is the total time to heapify?
40 / 50
Algorithm is a mathematical entity, which is independent of a specific machine and operating system.
41 / 50
For the Sieve Technique we take time
42 / 50
Sieve Technique applies to problems where we are interested in finding a single item
from a larger set of _____________
43 / 50
Sorting is one of the few problems where provable ________ bonds exits on how fast we can sort,
44 / 50
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.
45 / 50
When we call heapify then at each level the comparison performed takes time
46 / 50
47 / 50
In Quick sort, we don’t have the control over the sizes of recursive calls
48 / 50
The array to be sorted is not passed as argument to the merge sort algorithm.
49 / 50
The Knapsack problem belongs to the domain of _______________ problems.
50 / 50
Quick sort is best from the perspective of Locality of reference.
Your score is
The average score is 40%
Restart quiz