Algorithms MCQ Quiz in मल्याळम - Objective Question with Answer for Algorithms - സൗജന്യ PDF ഡൗൺലോഡ് ചെയ്യുക

Last updated on Mar 8, 2025

നേടുക Algorithms ഉത്തരങ്ങളും വിശദമായ പരിഹാരങ്ങളുമുള്ള മൾട്ടിപ്പിൾ ചോയ്സ് ചോദ്യങ്ങൾ (MCQ ക്വിസ്). ഇവ സൗജന്യമായി ഡൗൺലോഡ് ചെയ്യുക Algorithms MCQ ക്വിസ് പിഡിഎഫ്, ബാങ്കിംഗ്, എസ്എസ്‌സി, റെയിൽവേ, യുപിഎസ്‌സി, സ്റ്റേറ്റ് പിഎസ്‌സി തുടങ്ങിയ നിങ്ങളുടെ വരാനിരിക്കുന്ന പരീക്ഷകൾക്കായി തയ്യാറെടുക്കുക

Latest Algorithms MCQ Objective Questions

Top Algorithms MCQ Objective Questions

Algorithms Question 1:

All statements, except for the recursive calls F(n), have O(1) time complexity for the below given flow chart.  If the worst-case time complexity of this function is O(nλ ), then the least possible (accurate up to one decimal position) of λ is _______.

F1 R.S Shraddha 28.12.2019 D1

Answer (Detailed Solution Below) 1.60 - 1.65

Algorithms Question 1 Detailed Solution

Answer: 1.6 to 1.65

Explanation:

The worst-case happens for the recursive calls on the longer route.

There are 6 such recursive calls to A(n/3) in the worst case.

So, recurrence relation will become like this:

F (n) = 6F(n/3) + O(1)

where O(1) is constant

By using master’s theorem,

a = 6, b =3

\({\rm{O}}\left( {{{\rm{n}}^{{{\log }_3}6}}} \right) = {\rm{\;O}}({{\rm{n}}^{1.63}})\)

\({\rm{O}}({{\rm{n}}^{\rm{\lambda }}}) = {\rm{O}}({{\rm{n}}^{1.63}}){\rm{\;}}\)

λ = 1.63

Algorithms Question 2:

Consider the following undirected graph with edge weights as shown:

F2 Gaurav Mankar 31-3-2021 Swati D15
The number of minimum-weight spanning trees of the graph is ______

Answer (Detailed Solution Below) 3

Algorithms Question 2 Detailed Solution

Answer:3 to 3

Concept:

A minimum spanning tree (MST) or minimum weight spanning tree is a subset of the edges(V – 1 ) of a connected, edge-weighted undirected graph G(V, E) that connects all the vertices together, without any cycles and with the minimum possible total edge weight.

Explanation:

The minimum weight in the graph is 0.1 choosing this we get.

F1 Raju.S 01-04-21 Savita D17

Suppose we get two trees T1 and T2.

To connect to those two trees we got 3 possible edges of weight 0.9.

Hence we can choose any one of those 3 edges.

No of Minimum weight spanning tree is 3.

Algorithms Question 3:

Consider the following C function.

int fun(int n) {

            int i, j;

            for (i = 1; i < = n; i++) {

            for (j = 1; j < n; j + = i) {

                                    printf (‘’ %d %d’’, i, j);

            }

            }

}

Time complexity of fun in terms of Θ notation is

  1. Θ (n√n)
  2. Θ (n2)
  3. Θ (nlog n)
  4. Θ (n2log n)

Answer (Detailed Solution Below)

Option 3 : Θ (nlog n)

Algorithms Question 3 Detailed Solution

We have to check how many times inner loop will be executed here.

For i=1,

j will run 1 + 2 + 3 + …………. (n times)

For i=2

j will run for 1,3,5, 7, 9, 11,………..(n/2 times)

For i=3

j will run for 1,4,7,10, 13…………… (n/3 times)

So, in this way,

\(T\left( n \right) = n + \frac{n}{2} + \frac{n}{3} + \frac{n}{4} + \frac{n}{5} + \frac{n}{6} \ldots + \frac{n}{n}\)

\(= n\left( {1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + \frac{1}{5} + \frac{1}{6} \ldots + \frac{1}{n}} \right)\;\)

So, Time complexity of given program = Θ (n log n)

Algorithms Question 4:

Which Sorting method is an external Sort?

  1. Heap Sort
  2. Quick Sort
  3. Insertion Sort 
  4. None of the above 

Answer (Detailed Solution Below)

Option 4 : None of the above 

Algorithms Question 4 Detailed Solution

Concept:

External sorting is sorting the lists that are so large that the whole list cannot be contained in the internal memory of a computer.

Explanation:

All heap sort, quick sort and insertion sort uses the concept of internal sorting. In internal sorting, data that has to be stored will be in main memory always and it implies faster access.

Important Point:

Example of external sorting is merge sort algorithm

External merge sort algorithm steps:

→ Data is stored in intermediate files

→ intermediate files are sorted and merged.

External sorting algorithms by external memory model in which a cache or internal memory is considered and an unbounded external memory is divided into blocks and time complexity is the number of memory transfers between internal and external memory.

Algorithms Question 5:

The maximum number of spanning tree possible for graph K5 is _____.

  1. 625
  2. 125
  3. 20
  4. 10

Answer (Detailed Solution Below)

Option 2 : 125

Algorithms Question 5 Detailed Solution

Data:

K5 is a complete graph with 5 vertex, that is, n = 5

Formula:

maximum number of spanning tree possible = nn - 2

Calculation:

maximum number of spanning tree = 55-2 = 125

Algorithms Question 6:

Let f(n) = n and g(n) = n(1 + sin n), where n is a positive integer. Which of the following statements is/are correct?

I. f(n) = O(g(n))

II. f(n) = Ω(g(n))

  1. Only I
  2. Only II
  3. Both I and II
  4. Neither I nor II

Answer (Detailed Solution Below)

Option 4 : Neither I nor II

Algorithms Question 6 Detailed Solution

Concept:

Sin function value ranges from -1 to + 1. (-1, 0, 1)

Explanation:

Case 1: when sin(n) is -1,

g(n) = n(1 - 1) = n0 = 1

so, for this case f(n) > g(n) i.e. g(n) = O (f(n))

So, statement 1 is incorrect.

Case 2: when sin(n) is +1,

g(n) = n(1 + 1) = n2

so, for this case f(n) < g(n) i.e. f(n) = O(g(n))

but for this, second statement i.e. f(n) = Ω(g(n)) is incorrect.

Both statements are not true for all values of sin(n).

Hence, option 4 is correct answer.

Algorithms Question 7:

Let the length of sorted arrays of A1, A2, A3, A4, A5, and A6 be 41, 30, 15, 80, 25 and 50 respectively. To merge them into a single array A by merging two arrays at a time using optimal algorithm. In worst case, the maximum number of comparisons needed is _____.

Answer (Detailed Solution Below) 587

Algorithms Question 7 Detailed Solution

The optimal algorithm always selects the smallest sequences for merging.

Given sequence: 41, 30, 15, 80, 25, 50

Ascending order: 15, 25, 30, 41, 50, 80

Merge(15, 25) → new size (40)

Number of comparisons = 25 + 15 – 1 = 39  

Merge(30, 40) → new size (70)

Number of comparisons = 30 + 40 – 1 = 69  

Merge(41, 50) → new size (91)

Number of comparisons = 41 + 50 – 1 = 90

Merge(70, 80) → new size (150)

Number of comparisons = 70 + 80 – 1 = 149  

Merge(91, 150) → new size (241)

Number of comparisons = 91 + 150 – 1 = 240

Therefore, total number of comparisons, 39 + 69 + 90 + 149 + 240 = 587

Algorithms Question 8:

Which one of the diagrams is used to start/stop in a flowchart?

  1. qImage16038
  2. qImage16039
  3. qImage16040
  4. qImage16041

Answer (Detailed Solution Below)

Option 3 : qImage16040

Algorithms Question 8 Detailed Solution

The correct answer is option 3.

Concept

  • A flowchart is a diagrammatic representation that illustrates a solution model to a given problem. It is used to depict the process of an operation or task, from startups to completion. It's a useful tool for visualizing a process, which can help to better understand, analyze, or improve it.

Key Points

Symbol

Diagram

Function

Parallelogram

flowchart-symbol-data

A parallelogram represents part of an input or output.

Arrows

flowchart-symbol-flow

A line is a connector that shows the relationship between the representative shape.

Oval

flowchart-symbol-terminator

A oval represents start and endpoint.

Diamond

flowchart-symbol-decision

A diamond represents a decision.

Rectangle

flowchart-symbol-process

A rectangle represents a Process.

Algorithms Question 9:

What is the complexity of selection sort algorithms?

  1. O(n)
  2. O(n2)
  3. O(2n)
  4. O(nlog2n)

Answer (Detailed Solution Below)

Option 2 : O(n2)

Algorithms Question 9 Detailed Solution

Key Points

The time complexity of selection sort = Number of swaps + number of comparisons.

= n swaps + n2 comparisons.

The time complexity of selection sort = O(n2).

Hence the correct answer is O(n2).

Additional Information

Algorithm Time Complexity
Best Average Worst
Selection Sort (Ωn2) θ(n2) O(n2)
Bubble Sort Ω(n) θ(n2) O(n2)  
Insertion Sort Ω(n) θ(n2) O(n2)
Heap Sort   Ω(n log(n)) θ(n log(n)) O(n log(n))
Quick Sort Ω(n log(n)) θ(n log(n)) O(n2)  
Merge Sort Ω(n log(n)) θ(n log(n)) O(n log(n))  
Bucket Sort Ω(n+k) θ(n+k) O(n2)
Radix Sort Ω(nk) θ(nk) O(nk)

Algorithms Question 10:

Consider the following code snippet. It accepts a positive integer n as input,.

int i= 0, j = 0, val = 1;

for (i = 1; i < = n; i++) {

                j = n;

                if (i% 2 == 0) {

                while (j > 1) {

                val = val * j;

               j = j/2;

                }

     }

}

What is the worst-case time complexity of the algorithm?

  1. O(n)
  2. O(n log n)
  3. O(n2)
  4. O(n2 log n)

Answer (Detailed Solution Below)

Option 2 : O(n log n)

Algorithms Question 10 Detailed Solution

Code Explanation:

int i= 0, j = 0, val = 1;

for (i = 1; i < = n; i++) / n times Time complexity = O(n)

{

j = n;

if (i% 2 == 0)   / out of n only n/2 times if will run

{

while (j > 1) {  /log n times, since j = n

val = val * j;

j = j/2;           / j decrease in power of 2 leads to log n

}

}

}

Outer for loop = O(n)

Inner for loop = O(log n)

Since nested loop

Time complexity = O(n) × O(log n) = O(n log n)

Get Free Access Now
Hot Links: teen patti lucky teen patti master app teen patti real teen patti gold new version 2024 teen patti customer care number