Humanities/Arts Exam  >  Humanities/Arts Questions  >  Which of the following sorting algorithm requ... Start Learning for Free
Which of the following sorting algorithm required the least swap to sort the following list?
L1: [52,18,16,12,36,26,22]
  • a)
    Insertion sort
  • b)
    Selection sort
  • c)
    Bubble sort
  • d)
    Same for bubble and selection sort.
Correct answer is option 'B'. Can you explain this answer?
Most Upvoted Answer
Which of the following sorting algorithm required the least swap to so...
Selection sort is a sorting algorithm in which the smallest element always move to the extreme left corner of the list, 
Point to remember - If the array is sorted in ascending order, even though the selection sort takes the same number of comparisons, as of unsorted array. The maximum number of swaps and comparisons are required when the array is sorted in descending order. 
Now, applying selection sort on L1- [52,18,16,12,36,26,22]
Minimum element in the list is 12 , So, swap 52 with 12. 
After 1st pass - [12,18,16,52,36,26,22]    (1 swap) 
The minimum element is 16 now, swap 18 with 16. 
After 2nd pass - [12,16,18,52,36,26,22]  (1 swap) 
In the 3rd pass, no change as 18 is in the correct position. 
After 3rd pass - [12,16,18,52,36,26,22] 
Now, 22 is the minimum element, swap 52 with 22.
After 4th pass - [12,16,18,22,36,26,52]  (1 swap) 
Minimum element is now 26 , swap 36 , with 26 
After 5th pass - [12,16,18,22,26,36,52] (1 swap) 
Now, the list is already sorted after the 5th pass, so, a total of 4 swaps are required for the selection sort.
So, option 2 will be the answer. 
Explore Courses for Humanities/Arts exam

Similar Humanities/Arts Doubts

Top Courses for Humanities/Arts

Which of the following sorting algorithm required the least swap to sort the following list?L1: [52,18,16,12,36,26,22]a)Insertion sortb)Selection sortc)Bubble sortd)Same for bubble and selection sort.Correct answer is option 'B'. Can you explain this answer?
Question Description
Which of the following sorting algorithm required the least swap to sort the following list?L1: [52,18,16,12,36,26,22]a)Insertion sortb)Selection sortc)Bubble sortd)Same for bubble and selection sort.Correct answer is option 'B'. Can you explain this answer? for Humanities/Arts 2024 is part of Humanities/Arts preparation. The Question and answers have been prepared according to the Humanities/Arts exam syllabus. Information about Which of the following sorting algorithm required the least swap to sort the following list?L1: [52,18,16,12,36,26,22]a)Insertion sortb)Selection sortc)Bubble sortd)Same for bubble and selection sort.Correct answer is option 'B'. Can you explain this answer? covers all topics & solutions for Humanities/Arts 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Which of the following sorting algorithm required the least swap to sort the following list?L1: [52,18,16,12,36,26,22]a)Insertion sortb)Selection sortc)Bubble sortd)Same for bubble and selection sort.Correct answer is option 'B'. Can you explain this answer?.
Solutions for Which of the following sorting algorithm required the least swap to sort the following list?L1: [52,18,16,12,36,26,22]a)Insertion sortb)Selection sortc)Bubble sortd)Same for bubble and selection sort.Correct answer is option 'B'. Can you explain this answer? in English & in Hindi are available as part of our courses for Humanities/Arts. Download more important topics, notes, lectures and mock test series for Humanities/Arts Exam by signing up for free.
Here you can find the meaning of Which of the following sorting algorithm required the least swap to sort the following list?L1: [52,18,16,12,36,26,22]a)Insertion sortb)Selection sortc)Bubble sortd)Same for bubble and selection sort.Correct answer is option 'B'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Which of the following sorting algorithm required the least swap to sort the following list?L1: [52,18,16,12,36,26,22]a)Insertion sortb)Selection sortc)Bubble sortd)Same for bubble and selection sort.Correct answer is option 'B'. Can you explain this answer?, a detailed solution for Which of the following sorting algorithm required the least swap to sort the following list?L1: [52,18,16,12,36,26,22]a)Insertion sortb)Selection sortc)Bubble sortd)Same for bubble and selection sort.Correct answer is option 'B'. Can you explain this answer? has been provided alongside types of Which of the following sorting algorithm required the least swap to sort the following list?L1: [52,18,16,12,36,26,22]a)Insertion sortb)Selection sortc)Bubble sortd)Same for bubble and selection sort.Correct answer is option 'B'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Which of the following sorting algorithm required the least swap to sort the following list?L1: [52,18,16,12,36,26,22]a)Insertion sortb)Selection sortc)Bubble sortd)Same for bubble and selection sort.Correct answer is option 'B'. Can you explain this answer? tests, examples and also practice Humanities/Arts tests.
Explore Courses for Humanities/Arts exam

Top Courses for Humanities/Arts

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev