Thursday , 21 November 2024

CS502 latest Solved MCQs Mega Collection for mid term papers

How much time merge sort takes for an array of numbers?

Select correct option:

  1. T(n^2)
  2. T(n)
  3. T( log n)
  4. T(n log n)

 

For the heap sort we store the tree nodes in

Select correct option:

  1. level-order traversal
  2. in-order traversal
  3. pre-order traversal
  4. post-order traversal

 

Sorting is one of the few problems where provable ________ bonds exits on

how fast we can sort,

Select correct option:

  1. upper
  2. lower
  3. average
  4. log n

 

single item from a larger set of _____________

Select correct option:

  1. n items
  2. phases
  3. pointers
  4. constant

 

A heap is a left-complete binary tree that conforms to the ___________

Select correct option:

  1. increasing order only
  2. decreasing order only
  3. heap order
  4. (log n) order

 

In the analysis of Selection algorithm, we make a number of passes, in fact it could be as many as,

Select correct option:

  1. T(n)
  2. T(n / 2)
  3. log n
  4. n / 2 + n / 4

 

The reason for introducing Sieve Technique algorithm is that it illustrates a

very important special case of,

Select correct option:

  1. divide-and-conquer
  2. decrease and conquer
  3. greedy nature
  4. 2-dimension Maxima

 

The sieve technique works in ___________ as follows

Select correct option:

  1. phases
  2. numbers
  3. integers
  4. routines

 

For the Sieve Technique we take time

Select correct option:

  1. T(nk)
  2. T(n / 3)
  3. n^2
  4. n/3

 

In the analysis of Selection algorithm, we eliminate a constant fraction of the

array with each phase; we get the convergent _______________ series in the

  1. analysis,
  2. linear arithmetic
  3. geometric
  4. exponent

 

Analysis of Selection algorithm ends up with,

Select correct option:

  1. T(n)
  2. T(1 / 1 + n)
  3. T(n / 2)
  4. T((n / 2) + n)

In in-place sorting algorithm is one that uses arrays for storage :
Select correct option:

  1. An additional array
  2. No additional array
  3. Both of above may be true according to algorithm
  4. More than 3 arrays of one dimension.

Which sorting algorithn is faster :
Select correct option:

  1. O(n^2)
  2. O(nlogn)
  3. O(n+k)
  4. O(n^3)

In stable sorting algorithm:
Select correct option:

  1. One array is used
  2. In which duplicating elements are not handled.
  3. More then one arrays are required.
  4. Duplicating elements remain in same relative posistion after sorting.

Counting sort has time complexity:
Select correct option:

  1. O(n)
  2. O(n+k)
  3. O(k)
  4. O(nlogn)

Counting sort is suitable to sort the elements in range 1 to k:
Select correct option:

  1. K is large
  2. K is small
  3. K may be large or small
  4. None

Memorization is :
Select correct option:

  1. To store previous results for further use.
  2. To avoid unnecessary repetitions by writing down the results of recursive calls and looking them again if needed later
  3. To make the process accurate.
  4. None of the above

The running time of quick sort depends heavily on the selection of
Select correct option:

  1. No of inputs
  2. Arrangement of elements in array
  3. Size o elements
  4. Pivot elements

Which may be stable sort:
Select correct option:

  1. Bubble sort
  2. Insertion sort
  3. Both of above

In Quick sort algorithm, constants hidden in T(n lg n) are
Select correct option:

  1. Large
  2. Medium
  3. Not known
  4. small

Quick sort is
Select correct option:

  1. Stable and In place
  2. Not stable but in place
  3. Stable and not in place
  4. Some time in place and send some time stable\

For the Sieve Technique we take time

  1. T(nk)
  2. T(n / 3)
  3. n^2
  4. n/3

The sieve technique is a special case, where the number of sub problems is just

Select correct option:

  • 5
  • Many
  • 1
  • Few

&

The reason for introducing Sieve Technique algorithm is that it illustrates a very important special case of,

Select correct option:

  1. Divide-and-conquer
  2. decrease and conquer
  3. greedy nature
  4. 2-dimension Maxima

 

Quick sort is

Select correct option:

  1. Stable and In place
  2. Not stable but in place
  3. Stable and not in place
  4. Some time in place and send some time stable

Memorization is :

Select correct option:

  • To store previous results for further use.
  • To avoid unnecessary repetitions by writing down the results of Recursive calls and looking them again if needed later
  • To make the process accurate.
  • None of the above

One Example of in place but not stable sort is

  • Quick
  • Heap
  • Merge
  • Bubble

 

The running time of quick sort depends heavily on the selection of

Select correct option:

  • No of inputs
  • Arrangement of elements in array
  • Size o elements
  • Pivot elements

 

In Quick sort algorithm, constants hidden in T(n lg n) are

Select correct option:

  1. Large
  2. Medium
  3. Not known
  4. Small

 

Which may be stable sort:
Select correct option:

  1. Bubble sort
  2. Insertion sort
  3. Both of above
  4. Selection sort

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,
Select correct option:

  1. linear
  2. arithmetic
  3. geometric
  4. exponent

In Quick sort algorithm, constants hidden in T(n lg n) are
Select correct option:

  1. Large
  2. Medium
  3. Not known
  4. small

How much time merge sort takes for an array of numbers?
Select correct option:

  1. T(n^2)
  2. T(n)
  3. T( log n)
  4. T(n log n)

Counting sort has time complexity:
Select correct option:

  1. O(n)
  2. O(n+k)
  3. O(k)
  4. O(nlogn)

In which order we can sort?
Select correct option:

  1. increasing order only
  2. decreasing order only
  3. increasing order or decreasing order
  4. both at the same time

A (an) _________ is a left-complete binary tree that conforms to the heap order
Select correct option:

  1. heap
  2. binary tree
  3. binary search tree
  4. array

The analysis of Selection algorithm shows the total running time is indeed ________in n,
Select correct option:

  1. arithmetic
  2. geometric
  3. linear
  4. orthogonal

Quick sort is based on divide and conquer paradigm; we divide the problem on base of pivot element and:
Select correct option:

  1. There is explicit combine process as well to conquer the solution.
  2. No work is needed to combine the sub-arrays, the array is already sorted
  3. Merging the sub arrays
  4. None of above.

Sorting is one of the few problems where provable ________ bonds exits on how fast we can sort,
Select correct option:

  1. upper
  2. lower
  3. average
  4. log n

In the analysis of Selection algorithm, we make a number of passes, in fact it could be as many as,

  1. T(n)
  2. T(n / 2)
  3. log n
  4. n / 2 + n / 4

 

Quick sort is based on divide and conquer paradigm; we divide the problem on base of

pivot element and:

  1. There is explicit combine process as w ell to conquer
  2. No w ork is needed to combine the sub-arrays, the a
  3. Merging the subarrays
  4. None of above

 

The number of nodes in a complete binary tree of height h is

  1. 2^(h+1) – 1
  2. 2 * (h+1) – 1
  3. 2 * (h+1)
  4. ((h+1) ^ 2) – 1

 

How many elements do we eliminate in each time for the Analysis of Selection

algorithm?

  1. n / 2 elements
  2. (n / 2) + n elements
  3. n / 4 elements
  4. 2 n elements

 

Which sorting algorithn is faster :

  1. O(n^2)
  2. O(nlogn)
  3. O(n+k)
  4. O(n^3)

 

We do sorting to,

  1. keep elements in random positions
  2. keep the algorithm run in linear order
  3. keep the algorithm run in (log n) order
  4. keep elements in increasing or decreasing order

 

Slow sorting algorithms run in,

  1. T(n^2)
  2. T(n)
  3. T( log n)
  4. T(n log n)

 

One of the clever aspects of heaps is that they can be stored in arrays without using any

_______________.

  1. Pointers
  2. Constants
  3. Variables
  4. Functions

 

Counting sort is suitable to sort the elements in range 1 to k:

  1. K is large
  2. K is small
  3. K may be large or small
  4. None

 

We do sorting to,
Select correct option:

  1. keep elements in random positions
  2. keep the algorithm run in linear order
  3. keep the algorithm run in (log n) order
  4. keep elements in increasing or decreasing order

Question # 2 of 10 ( Start time: 06:19:38 PM ) Total Marks: 1
Heaps can be stored in arrays without using any pointers; this is due to the ____________ nature of the binary tree,
Select correct option:

  1. left-complete
  2. right-complete
  3. tree nodes
  4. tree leaves

Question # 3 of 10 ( Start time: 06:20:18 PM ) Total Marks: 1
Sieve Technique can be applied to selection problem?
Select correct option:

  1. True
  2. False

Question # 4 of 10 ( Start time: 06:21:10 PM ) Total Marks: 1
A heap is a left-complete binary tree that conforms to the ___________
Select correct option:

  1. increasing order only
  2. decreasing order only
  3. heap order
  4. (log n) order

Question # 5 of 10 ( Start time: 06:21:39 PM ) Total Marks: 1
A (an) _________ is a left-complete binary tree that conforms to the heap order
Select correct option:

  1. heap
  2. binary tree
  3. binary search tree
  4. array

Question # 6 of 10 ( Start time: 06:22:04 PM ) Total Marks: 1
Divide-and-conquer as breaking the problem into a small number of
Select correct option:

  1. pivot
  2. Sieve
  3. smaller sub problems
  4. Selection

Question # 7 of 10 ( Start time: 06:22:40 PM ) Total Marks: 1
In Sieve Technique we do not know which item is of interest
Select correct option:

  1. True
  2. False

Question # 8 of 10 ( Start time: 06:23:26 PM ) Total Marks: 1
The recurrence relation of Tower of Hanoi is given below T(n)={1 if n=1 and 2T(n-1) if n >1 In order to move a tower of 5 rings from one peg to another, how many ring moves are required?
Select correct option:

  • 16
  • 10
  • 32
  • 31

Question # 9 of 10 ( Start time: 06:24:44 PM ) Total Marks: 1
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,
Select correct option:

  1. linear
  2. arithmetic
  3. geometric 
  4. exponent

Question # 10 of 10 ( Start time: 06:25:43 PM ) Total Marks: 1
For the heap sort, access to nodes involves simple _______________ operations.
Select correct option:

  1. arithmetic
  2. binary
  3. algebraic
  4. logarithmic

For the sieve technique we solve the problem,
Select correct option:

  1. recursively
  2. mathematically
  3. precisely
  4. accurately

The sieve technique works in ___________ as follows
Select correct option:

  1. phases
  2. numbers
  3. integers
  4. routines

Slow sorting algorithms run in,
Select correct option:

  1. T(n^2)
  2. T(n)
  3. T( log n)

A (an) _________ is a left-complete binary tree that conforms to the heap order
Select correct option:

  1. heap
  2. binary tree
  3. binary search tree
  4. array

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,
Select correct option:

  1. linear
  2. arithmetic
  3. geometric
  4. exponent

In the analysis of Selection algorithm, we make a number of passes, in fact it could be as many as,
Select correct option:

  1. T(n)
  2. T(n / 2)
  3. log n
  4. n / 2 + n / 4

The sieve technique is a special case, where the number of sub problems is just
Select correct option:

  • 5
  • many
  • 1
  • few

In which order we can sort?
Select correct option:

  1. increasing order only
  2. decreasing order only
  3. increasing order or decreasing order
  4. both at the same time

The recurrence relation of Tower of Hanoi is given below T(n)={1 if n=1 and 2T(n-1) if n >1 In order to move a tower of 5 rings from one peg to another, how many ring moves are required?
Select correct option:

  • 16
  • 10
  • 32
  • 31

Analysis of Selection algorithm ends up with,
Select correct option:

  1. T(n)
  2. T(1 / 1 + n)
  3. T(n / 2)
  4. T((n / 2) + n)

We do sorting to,
Select correct option:

  1. keep elements in random positions
  2. keep the algorithm run in linear order
  3. keep the algorithm run in (log n) order
  4. keep elements in increasing or decreasing order

Divide-and-conquer as breaking the problem into a small number of
Select correct option:

  1. pivot
  2. Sieve
  3. smaller sub problems
  4. Selection

The analysis of Selection algorithm shows the total running time is indeed ________in n,
Select correct option:

  1. arithmetic
  2. geometric
  3. linear 
  4. orthogonal

How many elements do we eliminate in each time for the Analysis of Selection algorithm?
Select correct option:

n / 2 elements
(n / 2) + n elements
n / 4 elements
2 n elements

Sieve Technique can be applied to selection problem?
Select correct option:

  1. True 
  2. false

For the heap sort we store the tree nodes in
Select correct option:

  1. level-order traversal
  2. in-order traversal
  3. pre-order traversal
  4. post-order traversal

One of the clever aspects of heaps is that they can be stored in arrays without using any _______________.
Select correct option:

  1. pointers
  2. constants
  3. variables
  4. functions

A (an) _________ is a left-complete binary tree that conforms to the heap order
Select correct option:

  1. heap
  2. binary tree
  3. binary search tree
  4. array

Divide-and-conquer as breaking the problem into a small number of
Select correct option:

  1. pivot
  2. Sieve
  3. smaller sub problems
  4. Selection

Heaps can be stored in arrays without using any pointers; this is due to the ____________ nature of the binary tree,
Select correct option:

  1. left-complete
  2. right-complete
  3. tree nodes
  4. tree leaves

For the sieve technique we solve the problem,
Select correct option:

  1. recursively
  2. mathematically
  3. precisely
  4. accurately

A heap is a left-complete binary tree that conforms to the ___________
Select correct option:

  1. increasing order only
  2. decreasing order only
  3. heap order
  4. (log n) order

We do sorting to,
Select correct option:

  1. keep elements in random positions
  2. keep the algorithm run in linear order
  3. keep the algorithm run in (log n) order
  4. keep elements in increasing or decreasing order

How many elements do we eliminate in each time for the Analysis of Selection algorithm?
Select correct option:

  1. n / 2 elements
  2. (n / 2) + n elements
  3. n / 4 elements
  4. 2 n elements

How much time merge sort takes for an array of numbers?
Select correct option:

  1. T(n^2)
  2. T(n)
  3. T( log n)
  4. T(n log n)

The reason for introducing Sieve Technique algorithm is that it illustrates a very important special case of,
Select correct option:

  1. divide-and-conquer
  2. decrease and conquer
  3. greedy nature
  4. 2-dimension Maxima

The number of nodes in a complete binary tree of height h is

Select correct option:

  1. 2^(h+1) – 1
  2. 2 * (h+1) – 1
  3. 2 * (h+1)
  4. ((h+1) ^ 2) – 1

A (an) _________ is a left-complete binary tree that conforms to the heap order
Select correct option:

  1. heap
  2. binary tree
  3. binary search tree
  4. array

In Sieve Technique we do not know which item is of interest
Select correct option:

  1. True
  2. False

Heaps can be stored in arrays without using any pointers; this is due to the
____________ nature of the binary tree,
Select correct option:

  1. left-complete
  2. right-complete
  3. tree nodes
  4. tree leaves

In the analysis of Selection algorithm, we make a number of passes, in fact it could be as
many as,
Select correct option:

  1. T(n)
  2. T(n / 2)
  3. log n
  4. n / 2 + n / 4



For the sieve technique we solve the problem,
Select correct option:

  1. recursively
  2. mathematically
  3. precisely
  4. accurately

Theta asymptotic notation for T (n) :
Select correct option:

  1. Set of functions described by: c1g(n)Set of functions described by c1g(n)>=f(n) for c1 s
  2. Theta for T(n)is actually upper and worst case comp
  3. Set of functions described by:
  4. c1g(n)

The sieve technique is a special case, where the number of sub problems is just
Select correct option:

  • 5
  • many
  • 1
  • few

Sieve Technique applies to problems where we are interested in finding a single item from a larger set of _____________
Select correct option:

  1. n items
  2. phases
  3. pointers
  4. constant

The sieve technique works in ___________ as follows
Select correct option:

  1. phases
  2. numbers
  3. integers
  4. routines

 

Memorization is?

  1. To store previous results for future use
  2. To avoid this unnecessary repetitions by writing down the results of recursive calls and looking them up again if we need them later
  3. To make the process accurate
  4. None of the above

 

Which sorting algorithm is faster

  1. O (n log n)
  2. O n^2
  3. O (n+k)
  4. O n^3

Quick sort is

  1. Stable & in place
  2. Not stable but in place
  3. Stable but not in place
  4. Some time stable & some times in place

 

One example of in place but not stable algorithm is

  1. Merger Sort
  2. Quick Sort
  3. Continuation Sort
  4. Bubble Sort

 

In Quick Sort Constants hidden in T(n log n) are

  1. Large
  2. Medium
  3. Small
  4. Not Known

 

Continuation sort is suitable to sort the elements in range 1 to k

  1. K is Large
  2. K is not known
  3. K may be small or large
  4. K is small

 

In stable sorting algorithm.

  1. If duplicate elements remain in the same relative position after sorting
  2. One array is used
  3. More than one arrays are required
  4. Duplicating elements not handled

 

Which may be a stable sort?

  1. Merger
  2. Insertion
  3.  Both above
  4. None of the above

 

An in place sorting algorithm is one that uses ___ arrays for storage

  1. Two dimensional arrays
  2. More than one array
  3. No Additional Array
  4. None of the above

Continuing sort has time complexity of ?

  1. O(n)
  2. O(n+k)
  3. O(nlogn)
  4. O(k)

We do sorting to,

  1. keep elements in random positions
  2. keep the algorithm run in linear order
  3. keep the algorithm run in (log n) order
  4. keep elements in increasing or decreasing order

In Sieve Technique we do not know which item is of interest

  1.  True
  2. False

A (an) _________ is a left-complete binary tree that conforms to the heap order

  1. heap
  2. binary tree
  3. binary search tree
  4. array

 

The sieve technique works in ___________ as follows

  1. phases
  2. numbers
  3. integers
  4. routines

 

For the sieve technique we solve the problem,

  1. recursively
  2. mathematically
  3. precisely
  4. accurately

For the heap sort, access to nodes involves simple _______________

operations.

  1. arithmetic
  2. binary
  3. algebraic
  4. logarithmic

 

The analysis of Selection algorithm shows the total running time is

indeed ________in n,\

  1. arithmetic
  2. geometric
  3. linear
  4. orthogonal

 

For the heap sort, access to nodes involves simple _______________ operations.

Select correct option:

  1. arithmetic
  2. binary
  3. algebraic
  4. logarithmic

 

Sieve Technique applies to problems where we are interested in finding a

single item from a larger set of _____________

Select correct option:

  1. n items
  2. phases
  3. pointers
  4. constant

 

In Sieve Technique we do not know which item is of interest

Select correct option:

  1. True
  2. False

 CS502 Solved MCQs Mega Collection for Mid Term Papers Try To solved Yourself

Check Also

CS615 Today Solved Quiz 03 Fall 2013 Solved By Arslan Ali

Quiz Start Time: 08:18 PM Time Left 63 sec(s) Question # 1 of 10 ( …

Leave a Reply

Your email address will not be published. Required fields are marked *

*