>
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
A and B together can complete a task in 10 days. A alone can finish it in 15 days. In how many days can B alone finish the work?
CUET (UG) - 2025
Time and Work
View Solution
What is the angle between the hour and minute hand at 3:30?
CUET (UG) - 2025
Clock and Calendar
View Solution
A man can row 24 km downstream in 3 hours and the same distance upstream in 6 hours. What is the speed of the boat in still water?
CUET (UG) - 2025
Boat and Stream
View Solution
A, B, C and D are partners in a firm sharing profits in the ratio of 3:2:1:4. A retired and his share is acquired by B and C in the ratio 3:2. Calculate the new profit sharing ratio of partners.
CUET (UG) - 2025
Partnership
View Solution
Rearrange the parts to form a logical sentence:
A) the city's new policy
B) has significantly improved
C) air quality
D) over the past year
CUET (UG) - 2025
Sentence Arrangement
View Solution
View More Questions