Powered By Blogger

Aug 4, 2021

Design and Analysis of Algorithm MCQ Unit-II

 

Unit- II

 

Q.1 Indicator random Variables provide a convenient method for Converting

[A]Probabilities

[B]Expectation

[C]Both [A] and [B]

[D] None of these

 

Q.2  ........is the use of probability in the analysis of problems.

[A]Probabilistic analysis

[B]Worst case analysis

[C]Best case Analysis

[D]None of these

 

Q.3 What is the best case complexity of binary search in successful search?

[A] θ(n log n)

[B] (θlog n)

[C] θ(1)

[D] θ(n)

 

Q.4  What will be the worst case time complexity of merge sort?

[A] O(n log n)

[B] O(n²)

[C] O(n² log n)

[D] O(n log n²)

 

Q.5 Which of the following method is used for sorting in quick sort?

[A] merging

[B] partitioning

[C] selection

[D] exchanging

 

Q.6 What is time complexity for best case of Quick Sort?

[A] O(n log n)

[B] O(n²)

[C] O(n² log n)

[D] O(n log n²)

 

Q.7 The running time depend on

[A] partition is balanced or unbalance

[ B] input array

[C] pivot element position

[D] None of these

 

Q.8  An algorithm .......if its behaviour is determined not only by its input but also by values produced by random number generator.

[A]Sequential

[B]Randomized

[C]Parallel

[D]None of these

 

Q.9 The algorithm from which the input is random by referring to the running time of a ....................as an expected running time.

[A]Randomized algorithm

[B] Merge sort

[C]Bubble sort

[D] None of these

 

Q.10 What is the worst case time complexity of a quick sort algorithm?

 

[A] O(n)

[B] O(n log n)

[C] O(n²)

[D] O(log n)

 

Q.11 Which of the following sorting algorithms is the fastest?

[A] Merge sort

[B] Quick sort

[C] Insertion sort

[D] Shell sort

 

Q.12 Identify problem in which All permutations of the input are equally likely, a probabilistic analysis?

[A] TSP problem

[B]Hiring problem

[C] Greedy problem

[D] None of these

 

Q.13 Merge sort uses which of the following technique to implement sorting?

[A] backtracking

[B] greedy algorithm

[C] divide and conquer

[D] dynamic programming

 

Q.14 What is the advantage of recursive approach than an iterative approach?

[A] Consumes less memory

[B] Less code and easy to implement

[C] Consumes more memory

[D] More code has to be written

 

Q.15 Which of the following is not an application of binary search?

 [A] To find the lower/upper bound in an ordered sequence

[B] Union of intervals

[C] Debugging

[D] To search in unordered list

 

Q.16 Find the pivot element from the given input using median-of-three partitioning method. 8, 1, 4, 9, 6, 3, 5, 2, 7, 0.

 [A] 8

[B] 7

[C] 9

[D] 6

 

Q.17 A randomized algorithm uses random bits as input inorder to achieve a _____________ good performance over all possible choice of random bits.

[A] worst case

[B] best case

[C] average case

[D] none of the mentioned

 

Q.18 ................... is the use of probability in the analysis of problems.

[A] Probabilistic analysis

[B]Linear Analysis

[C]Quadratic Analysis

[D] None of these

 

Q.19 In Hiring Algorithm if candidate i is better than candidate best

 

[A] best=0

[B]best=i

[C] best=1

[D] None of these

 

Q.20  Worst case analysis of Hiring Algorithm is

[A] O(Chm)

[B] O(Cin+Chm)

[C] O(CiN)

[D] None of these

 

Q.21  Each of the possible n! permutations appears with equal probability then it is

[A] uniform random permutation

[B] random permutation

[C] uniform permutation

 [D] permutation

 

Q.22 Which algorithm provide a convenient method for converting between probabilities and expectations?

[A] Quick sort

[B] Indicator random variables

[C] Bubble sort

[D] None of these

 

Q.23 What is a randomized QuickSort?

 [A] The leftmost element is chosen as the pivot

[B] The rightmost element is chosen as the pivot

[C] Any element in the array is chosen as the pivot

[D] A random number is generated which is used as the pivot

 

Q.24 Choose the incorrect statement about merge sort from the following?

[A] it is a comparison based sort

[B] it is an adaptive algorithm

[C] it is not an in place algorithm

[D] it is stable algorithm

 

Q.25 Indicator random variable denoted by

[A] I{A}

[B] R{s}

[C] V{a}

[D] None of these

 

Q.26  What is the time complexity of uniform binary search?

[A] O(nlogn)

[B] O(logn)

[C] O(n)

[D] O(n²)

 

Q.27 In which of the cases uniform binary search fails compared to binary search?

 [A] A table lookup is generally faster than an addition and a shift

[B] Many searches will be performed on the same array

[C] Many searches will be performed on several arrays of the same length

[D] Complexity of code

 

Q.28 Which of the following stable sorting algorithm takes the least time when applied to an almost sorted array?

[A] Quick sort

[B] Insertion sort

[C] Selection sort

 [D] Merge sort

 

Q.29 Which of the following is not in place sorting algorithm by default?

[A] merge sort

[B] quick sort

[C] heap sort

[D] insertion sort

 

Q.30 Choose the correct statement about bottom up merge sort from the following?

 [A] bottom up merge sort has greater time complexity than standard merge sort

[B] bottom up merge sort has lesser time complexity than standard merge sort

[C] bottom up merge sort saves auxiliary space required on call stack

 [D] bottom up merge sort uses recursion.

Design and Analysis of Algorithms MCQ Unit- I

 

Unit-I

 

Q1. An algorithm is .............

 [A] a set of rules for carrying out calculation either by hand or on a machine

[B] a sequence of computational steps that transform the input into the output

[C] a sequence of operations performed on data organized in data structure [D] All of these

[D] All of these

 

Q.2 An algorithm must have the following Properties

[A]Finiteness

[B] Effectiveness

[C] Termination

[D]All of these

 

Q.3  Asymptotic notation (s) is (are)….

 [A] Big-oh notation

[B] Big-A notation

[C] Both A and B

[D] None of these

 Correct answer

[A] Big-oh notation

 

 

Q.4 What is the best case running time of an insertion sort algorithm?

[A] O[N]

[B] O[N log N]

[C] O[log N]

[D] O[N²]

 

Q.5  What is the worst case efficiency of bubble sort?

 [A] O[nlogn]

[B] O[logn]

[C] O[n]

[D] O[n²]

 

Q.6 For the worst case input, the running time of an insertion sort algorithm is?

A] Linear

[B] Binary

[C] Quadratic

[D] Depends on the input

 

Q.7 What is the running time of an insertion sort algorithm if the input is reverse-sorted?

[A] O[N²]

[B] O[N log N]

[C] O[N]

[D] O[M log N]

 

Q.8  Running merge sort on an array of size n which is already sorted is

[A] O(n)

[B] O(nlogn)

[C] O(n²)

[D] None

 

Q.9 If the given input array is sorted or nearly sorted, which of the following algorithm gives the best performance?

[A] Insertion sort

[B] Selection sort

[C] Quick sort

[D] Merge sort

 

Q.10 Time complexity of bubble sort in best case is

[A] θ (n)

[B] θ (nlogn)

[C] θ (n²)

[D] θ (n(logn) ²)

 

Q.11 Solve the following recurrence using Master’s theorem. T[n] = 9T [n/3] + n

 [A] T[n] = O[n]

[B] T[n] = O[log n]

[C] T[n] = O[n2log n]

[D] T[n] = O[n2]

 

Q.12  Identify variables by Master Therom for T[n]= 3T[n/4]+nlogn

[A] T[n] = O[n]

[B] T[n] = O[nlog n]

[C] T[n] = O[n²log n]

[D] T[n] = O[n²]

 

 

 

Q.13  I. Time complexity is time taken by an algorithm to run

           II. Space Complexity is space taken by an algorithm to store.

[A] Only I is correct

[B] Only II is correct

[C] Both are correct

 [D] both are wrong.

 

Q.14  The __________of an algorithm is an upper bound on the running time for any input.

 

[A] Worst case running time

[B] Average case running time

[C] best case running time

[D] Amortized running time

 

Q.15 The __________of an algorithm to perform a sequence of operations is averaged over all the operations performed.

A] Worst case running time

[B] Average case running time

[C] best case running time

[D] Amortized running time

 

Q.16 If for an algorithm time complexity is given by O(n) then complexity of it is:

[A] constant

[B] linear

[C] exponential

[D] none of the mentioned

 

Q.17  Master’s theorem is used for?

[A] solving recurrences

[B] solving iterative relations

[C] analysing loops

[D] calculating the time complexity of any code

 

Q.18 How many cases are there under Master’s theorem?

[A] 2

[B] 3

[C] 4

[D] 5

 

Q.19  Solve the following recurrence using Master’s theorem. T(n) = 4T (n/2) + n²

 

[A] T(n) = O(n)

[B] T(n) = O(log n)

[C] T(n) = O(n²log n)

[D] T(n) = O(n²)

 

Q.20 Solve the following recurrence using Master’s theorem. T(n) = T (n/2) + 2n

[A] T(n) = O(n2)

[B] T(n) = O(n2 log n)

[C] T(n) = O(2n)

[D] Cannot be solved

 

Q.21 Solve the following recurrence using Master’s theorem. T(n) = 16T (n/4) + n

 [A] T(n) = O(n)

[B] T(n) = O(log n)

[C] T(n) = O(n²log n)

[D] T(n) = O(n²)

 

Q.22 Solve the following recurrence using Master’s theorem.T(n) = 2T (n/2) + n/ log n

[A] T(n) = O(n)

[B] T(n) = O(log n)

[C] T(n) = O(n2log n)

 [D] cannot be solved using master’s theorem

 

Q.23  Which of the following examples represent the worst case input for an insertion sort?

[A] Array in sorted order

[B] Array sorted in reverse order

[C] Normal unsorted array

[D] Large array

 

Q.24  How many passes does an insertion sort algorithm consist of?

[A] N

[B] N-1

[C] N+1

[D] N²

 

 

Q.25 What is the worst case complexity of bubble sort?

 [A] O(nlogn)

[B] O(logn)

[C] O(n)

[D] O(n²)

 

Q.26   What is the average case complexity of bubble sort?

 [A] O(nlogn)

[B] O(logn)

[C] O(n)

[D] O(n²)

 

Q.27 An Algorithm is ___________

[A] A procedure for solving a problem

[B] A problem

[C] A real life mathematical problem

[D] None of the mentioned

 

Q.28 A Complexity of algorithm depends upon _________

[A] Time only

[B] Space only

[C] Both Time and Space

[D] None of the mentioned

 

Q.29 An algorithm: can be represented through _________

 [A] flow charts

[B] pseudo codes

[C] instructions in common language

[D] all of the mentioned

 

Q.30 There are two algorithms suppose A takes 1.41 milli seconds while B takes 0.9 milliseconds, which one of them is better considering all other things the same?

[A] A is better than B

[B] B is better than A

[C] Both are equally good

[D] None of the mentioned

 

Jul 27, 2021

Data Analytics MCQ Unit-III

 

UNIT- III

 

1.   ___________ is a branch of mathematics dealing with the collection, analysis, interpretation, presentation and organization of data.

[A]   Ordinal data
[B]   Constant data
[C]   Statistics
[D]  None of the above

 

2.   ____________deals with all aspects of data including the planning of data collection in terms of the design of surveys and experiments.

[A]   Ordinal data
[B]   Constant data
[C]   Statistics
[D]  None of the above

 

3.   ____________ is a branch which covers natural processes and phenomena and provides us the knowledge for decision making.
[A]   Ordinal data
[B]   Constant data
[C]   Applied statistics
[D]  None of the above

 

4.   ___________ is the process of breaking a complex topic or substance into smaller parts in order to gain a better understanding of it.
[A]   Statistics
[B]   Analysis
[C]   Applied statistics
[D]  None of the above

 

5.      _________data are called digital or binary data.
[A]   Continuous
[B]   Discrete
[C]   Both of the above
[D]  None of the above

 

6.      _________data types are called analog data.
[A]  Continuous
[B]   Discrete
[C]   Both of the above
[D]  None of the above

 

7.   ___________ represent items that can be counted, they take on possible values that can be listed out.
[A]   Continuous data
[B]   Discrete data
[C]   Both of the above
[D]  None of the above

 

8.   ___________ represent measurements, their possible values cannot be counted and can only be described using intervals on the real number line.
[A]  Continuous data
[B]   Discrete data
[C]   Both of the above
[D]  None of the above

 

9.   ___________ represents characteristics such as a person’s gender, hometown or the types of movies they like.
[A]   Continuous data
[B]   Discrete data
[C]   Categorical data
[D]  None of the above

 

10.              ___________ focused on descriptions and comparisons.
[A]   Predictive analytics
[B]   Descriptive analytics
[C]   Prescriptive analytics
[D]  None of the above

 

11.              ___________ focused on casual relationships and sequences.
[A]   Predictive analytics
[B]   Diagnostic inferential analytics
[C]   Prescriptive analytics
[D]  None of the above

 

12.              ___________ includes both frequentist and Bayesian causal inferential analyses. 
[A]   Predictive analytics
[B]   Diagnostic inferential analytics
[C]   Prescriptive analytics
[D]  None of the above

 

13.              ___________ focused on non-discrete predictions of future states, relationship and patterns.
[A]  Predictive analytics
[B]   Descriptive analytics
[C]   Prescriptive analytics
[D]  None of the above

 

14.              ___________ focused on optimal decisions for future situations.
[A]   Predictive analytics
[B]   Descriptive analytics
[C]   Prescriptive analytics
[D]  None of the above

 

15.              ___________ focused on consumption patterns and associated business outcomes.
[A]   Predictive analytics
[B]   Outcome analytics
[C]   Prescriptive analytics
[D]  None of the above

 

16.  Backward looking, Real-time and forward looking is used in __________________.
[A]   Predictive analytics
[B]   Prescriptive analytics
[C]   Outcome analytics
[D]  None of the above

 

17.   ____________ is the measure of the likelihood that an event will occur.
[A]   Frequency distribution
[B]   Probability
[C]   Median
[D]  None of the above

 

18.  A ____________ is a table or graph that displays the frequency of various outcomes in a sample.
[A]   Probability
[B]   Median
[C]   Frequency distribution
[D]  None of the above

 

19.  Measures means __________ and central tendency means __________ value of any statistical series.
[A]   average, methods
[B]   methods, average
[C]   both of the above
[D]  none of the above

 

20.  __________________ are main measures of central tendency.
[A]   Mean
[B]   Median
[C]   Mode
[D]  All of the above

 

21.  The ____________ is the middle score for a set of data that has been arranged in order of magnitude.
[A]   Mode
[B]   Median
[C]   Frequency distribution
[D]  None of the above

 

22.  The ____________ is the most frequent score in our data set.
[A]  Mode
[B]   Median
[C]   Frequency distribution
[D]  None of the above

 

23.  Which is / are types of statistical means______________________.
[A]   Geometric mean
[B]   Median
[C]   Mode
[D]  All of the above

 

24.  The ____________ may be a better indicator of the most typical value if a set of scores has an outlier.
[A]   Mode
[B]   Median
[C]   Frequency distribution
[D]  None of the above

 

25.  When the sample size is large and does not include outliers, the __________ score usually provides a better measure of central tendency.
[A]   Mode
[B]   Median
[C]   Mean
[D]  None of the above

 

26.  _____________is relevant on certain sets of data and is different from the arithmetic mean.
[A]  Geometric mean
[B]   Median
[C]   Mode
[D]  None of the above

 

27.  If type of variable is nominal, then __________ is the best measure of central tendency.
[A]  Mode
[B]   Median
[C]   Mean
[D]  None of the above

 

28.  If type of variable is ordinal, then __________ is the best measure of central tendency.
[A]   Mode
[B]   Median
[C]   Mean
[D]  None of the above

 

29.  If type of variable is interval/ratio (not skewed), then __________ is the best measure of central tendency.
[A]   Mode
[B]   Median
[C]   Mean
[D]  None of the above

 

30.  If type of variable is interval/ratio (skewed), then __________ is the best measure of central tendency.
[A]   Mode
[B]   Median
[C]   Mean
[D]  None of the above

Featured Post

Data Analysis

    What is data analysis and its significance?   Data analysis is the process of collecting, transforming, and organizing data to dr...

Popular Posts