>
Exams
>
Computer Science
>
Sorting Algorithms
>
the number of swaps made in pass 1 for the followi
Question:
The number of swaps made in pass 1 for the following list using Insertion sort is:
\[ 9, 8, 14, 2, -8, 5 \]
Show Hint
Insertion sort compares each element with the previous ones and swaps them into the correct position.
CUET (UG) - 2023
CUET (UG)
Updated On:
Apr 24, 2025
0
1
2
3
Hide Solution
Verified By Collegedunia
The Correct Option is
C
Solution and Explanation
In the first pass of insertion sort:
- 9 and 8 swap, resulting in: 8, 9, 14, 2, -8, 5.
- 14 is already in the correct place.
- 2 and 14 swap, followed by 2 and 9 swapping.
Thus, 2 swaps are made in pass 1.
Download Solution in PDF
Was this answer helpful?
0
0
Top Questions on Sorting Algorithms
............. sorts a given list of elements by repeatedly comparing the adjacent elements and swapping them if they are unordered.
CUET (UG) - 2023
Computer Science
Sorting Algorithms
View Solution
To sort a list having n elements, the Selection sort makes .......... number of passes through the list.
CUET (UG) - 2023
Computer Science
Sorting Algorithms
View Solution
For best case, linear search, searches
CUET (UG) - 2023
Computer Science
Sorting Algorithms
View Solution
Which of the following statement(s) is/are true?
A. When two elements map to the same slot in hash table, it is called hashing.
B. Linear search takes a sorted list and divides it in the middle.
C. Modulo division method is a Hashing method.
D. Traversing specifies whether the key is present in the list or not.
E. Binary search takes a sorted/ordered list and divides it in the middle.
CUET (UG) - 2023
Computer Science
Sorting Algorithms
View Solution
What will be the status of the list (given below) after pass 2 using Bubble sort?
\[ 8, 7, 13, 1, -9, 4 \]
CUET (UG) - 2023
Computer Science
Sorting Algorithms
View Solution
View All
Questions Asked in CUET exam
A shopkeeper increases the price of an article by 25% and then offers a discount of 20%. What is the net percentage change in the price?
CUET (UG) - 2025
Percentage
View Solution
If 1st March 2023 was a Wednesday, what day of the week was 1st March 2024?
CUET (UG) - 2025
Clock and Calendar
View Solution
Which region was known as the ‘nursery of the Bengal Army’ as many sepoys were recruited from there?
CUET (UG) - 2025
British Empire
View Solution
In a certain code, WATER is written as YCVGT. How is HOUSE written?
CUET (UG) - 2025
Coding Decoding
View Solution
A person walks 10 m North, then turns right and walks 5 m, then turns right again and walks 10 m. What direction is he facing now?
CUET (UG) - 2025
Direction sense
View Solution
View More Questions