Insertion Sort MCQ Quiz in मराठी - Objective Question with Answer for Insertion Sort - मोफत PDF डाउनलोड करा

Last updated on Mar 16, 2025

पाईये Insertion Sort उत्तरे आणि तपशीलवार उपायांसह एकाधिक निवड प्रश्न (MCQ क्विझ). हे मोफत डाउनलोड करा Insertion Sort एमसीक्यू क्विझ पीडीएफ आणि बँकिंग, एसएससी, रेल्वे, यूपीएससी, स्टेट पीएससी यासारख्या तुमच्या आगामी परीक्षांची तयारी करा.

Latest Insertion Sort MCQ Objective Questions

Top Insertion Sort MCQ Objective Questions

Insertion Sort Question 1:

The k-Means algorithm is an ______  algorithm.

  1. Supervised Learning
  2. Unsupervised Learning
  3. Semi-supervised Learning
  4. Reinforcement Learning
  5. None of the above

Answer (Detailed Solution Below)

Option 2 : Unsupervised Learning

Insertion Sort Question 1 Detailed Solution

The correct answer is Unsupervised Learning.

Key Points

1. Supervised Learning:

  • In supervised learning, the algorithm is trained on a labeled dataset, where the input data is paired with corresponding output labels.
  • The goal is to learn a mapping function from input to output so that the algorithm can make predictions or classifications on new, unseen data.

2. Unsupervised Learning:

  • In unsupervised learning, the algorithm is given data without explicit instructions on what to do with it.
  • The algorithm tries to find patterns, relationships, or structures within the data on its own.
  • Clustering algorithms, like k-Means, fall under unsupervised learning because they group similar data points together without using labeled output information.

3. Semi-supervised Learning:

  • Semi-supervised learning is a combination of supervised and unsupervised learning.
  • It involves a dataset that contains both labeled and unlabeled examples.
  • The algorithm is trained on the labeled data, and then it tries to make predictions on the unlabeled data by leveraging the patterns learned from the labeled data.

4. Reinforcement Learning:

  • Reinforcement learning involves an agent interacting with an environment and learning to make decisions by receiving feedback in the form of rewards or punishments.
  • The agent learns to take actions that maximize the cumulative reward over time.
  • Unlike supervised learning, where the algorithm is provided with explicit labeled examples, in reinforcement learning, the algorithm learns by trial and error.

In the case of the k-Means algorithm, it is unsupervised learning because it doesn't rely on labeled output data. Instead, it aims to partition the input data into clusters based on similarity, without using predefined class labels.

Insertion Sort Question 2:

Consider the following array and what is the status of the array after the fourth pass when we use the insertion sort?

Array Elements: 20, 16, 12, 8, 4, 1

  1. 16, 20, 12, 8, 4, 1
  2. 12, 16, 20, 8, 4, 1
  3. 8, 12, 16, 20, 4, 1
  4. 4, 8, 12, 16, 20, 1

Answer (Detailed Solution Below)

Option 4 : 4, 8, 12, 16, 20, 1

Insertion Sort Question 2 Detailed Solution

The correct answer is option 4.

Concept:

Insertion sort:

 Insertion sort is a basic sorting algorithm that operates in the same manner that you arrange cards in your hands. The array is divided into two halves, one sorted and one not. Values from the unsorted section are selected and placed in the sorted section at the appropriate location.

Explanation:

The given array is,

Input: 20, 16, 12, 8, 4, 1

Output:1, 4, 8, 12, 16, 20

Pass 1:
Consider the key is 16 and move the elements of array index 1 to 0
swaps are required because 20 is greater than 16.
Swap the elements 20 and 16
16, 20, 12, 8, 4, 1
No swaps are required because till array 1 index is sorted in order.
16, 20, 12, 8, 4, 1
Total swaps are=1
Pass 2:
Consider the key is 12 and move the elements of array index 2 to 0
swaps are required because 20 is greater than 12.
Swap the elements 20 and 12
16, 12, 20, 8, 4, 1
swaps are required because 16 is greater than 12.
Swap the elements 16 and 12
12, 16, 20, 8, 4, 1
No swaps are required because till the array 2 index is sorted in order.
12, 16, 20, 8, 4, 1
Total swaps are=3
Pass 3:
Consider the key is 8 and move the elements of array index 3 to 0
swaps are required because 20 is greater than 8.
Swap the elements 20 and 8
12, 16, 8, 20, 4, 1
swaps are required because 16 is greater than 8.
Swap the elements 16 and 8
12, 8, 16, 20, 4, 1
swaps are required because 12 is greater than 8.
Swap the elements 12 and 8
8, 12, 16, 20, 4, 1
No swaps are required because till array 3 index is sorted in order.
8, 12, 16, 20, 4, 1
Total swaps are=6
Pass 4:
Consider the key is 4 and move the elements of array index 4 to 0
swaps are required because 20 is greater than 4.
Swap the elements 20 and 4
8, 12, 16, 4, 20, 1
swaps are required because 16 is greater than 4.
Swap the elements 16 and 4
8, 12, 4, 16, 20, 1
swaps are required because 12 is greater than 4.
Swap the elements 12 and 4
8, 4, 12, 16, 20, 1
swaps are required because 8 is greater than 4.
Swap the elements 8 and 4
4, 8, 12, 16, 20, 1
No swaps are required because till array 4 index is sorted in order.
4, 8, 12, 16, 20, 1
Total swaps are=10
Pass 5:
Consider the key is 1 and move the elements of array index 5 to 0
swaps are required because 20 is greater than 1.
Swap the elements 20 and 1
4, 8, 12, 16, 1, 20
swaps are required because 16 is greater than 1.
Swap the elements 16 and 1
4, 8, 12, 1, 16, 20
swaps are required because 12 is greater than 1.
Swap the elements 12 and 1
4, 8, 1, 12, 16, 20
swaps are required because 8 is greater than 1.
Swap the elements 8 and 1
4, 1, 8, 12, 16, 20
swaps are required because 4 is greater than 1.
Swap the elements 4 and 1
1, 4, 8, 12, 16, 20
No swaps are required because till array 5 index is sorted in order.
1, 4, 8, 12, 16, 20
Total swaps are=15
The sorted array is
1, 4, 8, 12, 16, 20

Hence the correct answer is 4, 8, 12, 16, 20, 1.

 

Insertion Sort Question 3:

Which sorting is using the given example?

A player is playing a card game and sorting the cards. The Player first picks one card then picks the next card and put it after the first card if it is bigger or before the first card if it is smaller; then he picks another card and inserts it into its proper position.

  1. Bubble Sort
  2. Selection Sort
  3. Insertion Sort
  4. None of the above

Answer (Detailed Solution Below)

Option 3 : Insertion Sort

Insertion Sort Question 3 Detailed Solution

The correct answer is option 3.

Concept:

The given example is a player playing a card game and sorting the cards. The Player first picks one card then picks the next card and put it after the first card if it is bigger or before the first card if it is smaller; then he picks another card and inserts it into its proper position.

A player follows the Insertion sort, It is a straightforward sorting algorithm that works similarly to how you arrange cards in your hands. The cards are divided into two parts: sorted and unsorted. The values of cards from the unsorted component are selected and placed in the sorted part in the proper order.

Example:

F3 Savita Engineering 13-5-22 D2

Consider the cards already sorted with 2, 4, 5, and 10. An unsorted card is 7 and is placed in the right position of a set of cards. Here card 7 is compared with 2, 4, 5, and 10 placed card 7 before 10. 

Hence the correct answer is Insertion Sort.

Additional Information

  •  The selection sort algorithm sorts an array by continually picking the smallest member from the unsorted segment and placing it at the beginning (in ascending order). In a given array, the method keeps two subarrays. This is the subarray that has previously been sorted. The remaining unsorted subarray.
  • Bubble Sort is the most basic sorting algorithm, which operates by exchanging neighbouring components in the wrong order repeatedly.

Insertion Sort Question 4:

Let A[i] : i = 0, 1, 2, . . . , n - 1 be an array of n distinct integers. We wish to sort A in ascending order. We are given that each element in the array is at a position that is at most k away from its position in the sorted array, that is, we are given that A[i] will move to a position in {i - k, i - k + 1, . . . , i, . . . , i + k - 1, i + k} after the array is sorted in ascending order. Suppose insertion sort is used to sort this array: that is, in the i-th iteration, A[i] is compared with the elements in positions A[i - 1], A[i - 2], . . . until one that is smaller is found and A[i] is inserted after that element. Note that elements can be moved back when later insertions are made before them. Let t(n) be the worst-case number of comparisons made by insertion sort for such inputs. Then,

  1. t(n) = Θ(n2)
  2. t(n) = Θ(n log2 n)
  3. t(n) = Θ(nk log k)
  4. t(n) = Θ(n log2 k)
  5. t(n) = Θ(nk)

Answer (Detailed Solution Below)

Option 5 : t(n) = Θ(nk)

Insertion Sort Question 4 Detailed Solution

The correct answer is option 5.

Key Points

F1 Ankiet Ravi 16.08.2021 D2

We have an array A with n distinct integers and each element is at most k away from its position in the sorted array. And we need to move the elements to their actual positions so we need to compare at most k elements are in the sorted part of the array. For total n elements, each element required k comparison so Total (NK) comparisons are required and n swappings are required. So worst-case number of comparisons is t(n) = Θ(NK).  It exactly works like insertion sort.

Hence the correct answer is t(n) = Θ(nk).

Insertion Sort Question 5:

Which of the following algorithms will give best performance when items are nearly sorted?

  1. Insertion sort
  2. Quick sort
  3. Heap sort
  4. Merge sort

Answer (Detailed Solution Below)

Option 1 : Insertion sort

Insertion Sort Question 5 Detailed Solution

Insertion sort requires liner time i.e. O(n) to sort nearly sorted array.

Insertion Sort Question 6:

Let P be a quicksort program to sort numbers in ascending order. Let t1 and t2 be the time taken by the program for inputs [1 2 3 4 5] and [5 4 3 2 1] respectively. Which of the following holds?

  1. t1= t2
  2. t1 > t2
  3. t1 < t2
  4. t1 = t2 + 5 log 5

Answer (Detailed Solution Below)

Option 1 : t1= t2

Insertion Sort Question 6 Detailed Solution

Worst case of quicksort occurs when an array is in sorted order or in reverse order or all the elements in an array are the same.

Insertion Sort Question 7:

Any algorithm that finds an element x in a sorted list of n elements requires

______ comparisons.

  1. O(logn) comparisions
  2. O(nlogn) comparisions
  3. O(n) comparisions
  4. None of above

Answer (Detailed Solution Below)

Option 1 : O(logn) comparisions

Insertion Sort Question 7 Detailed Solution

A decision tree would have N leaves, so O(log N) comparisons are required.

Insertion Sort Question 8:

Any comparision based sorting algorithm will on average require

  1. O(logn) comparisions
  2. O(nlogn) comparisions
  3. O(n) comparisions
  4. None of above

Answer (Detailed Solution Below)

Option 2 : O(nlogn) comparisions

Insertion Sort Question 8 Detailed Solution

Any comparision based sorting algorithm will require O(nlogn) comparisions. Eg. Quick sort

Insertion Sort Question 9:

What is best and worst case complexity of Quick sort?

  1. O(nlogn) and O(n)
  2. O(nlogn) and O(n2)
  3. O(logn) and O(n2)
  4. none of above

Answer (Detailed Solution Below)

Option 2 : O(nlogn) and O(n2)

Insertion Sort Question 9 Detailed Solution

Worst case complexity of O(n2) occurs for Quick sort when input is already sorted.

Insertion Sort Question 10:

Which of the following sorting algorithms is most efficient for sorting large arrays with values in random order?

  1. Selection Sort
  2. Insertion Sort
  3. Merge Sort
  4. None

Answer (Detailed Solution Below)

Option 3 : Merge Sort

Insertion Sort Question 10 Detailed Solution

We will use merge sort technique as because its time complexity is (𝑛 log 𝑛) as well as it is external sort.
Get Free Access Now
Hot Links: teen patti gold new version 2024 teen patti 500 bonus teen patti game teen patti online game