>
Exams
>
Computer Science
>
Sorting Algorithms
>
what will be the status of the list given below af
Question:
What will be the status of the list (given below) after pass 2 using Bubble sort?
\[ 8, 7, 13, 1, -9, 4 \]
Show Hint
In Bubble sort, the largest element is placed at its correct position in each pass.
CUET (UG) - 2023
CUET (UG)
Updated On:
Apr 24, 2025
7, 8, 1, -9, 4, 13
7, 1, -9, 4, 8, 13
1, -9, 4, 7, 8, 13
-9, 1, 4, 7, 8, 13
Hide Solution
Verified By Collegedunia
The Correct Option is
B
Solution and Explanation
In the first pass of Bubble sort, the largest element (13) "bubbles" to the end. After the second pass:
- The 7 and 8 are swapped.
- Then 1 and 7 are swapped, followed by 1 and -9.
- The result after pass 2 is 7, 1, -9, 4, 8, 13.
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
The number of swaps made in pass 1 for the following list using Insertion sort is:
\[ 9, 8, 14, 2, -8, 5 \]
CUET (UG) - 2023
Computer Science
Sorting Algorithms
View Solution
View All
Questions Asked in CUET exam
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
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
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