Question
Download Solution PDFWhich of the following is not a stable sorting algorithm ?
This question was previously asked in
NIELIT Scientific Assistant CS 5 Dec 2021 Official Paper
Answer (Detailed Solution Below)
Option 2 : Selection sort
Free Tests
View all Free tests >
NIELIT Scientific Assistant Quantitative Aptitude Mock Test
0.5 K Users
20 Questions
20 Marks
30 Mins
Detailed Solution
Download Solution PDFThe correct answer is Selection sort.
- Selection sort is not a stable sorting algorithm.
- In a stable sorting algorithm, the relative order of equal elements is preserved.
- Selection sort does not guarantee that the relative order of equal elements will be maintained.
- This is because Selection sort works by repeatedly finding the minimum element and moving it to the correct position, which can disrupt the order of equal elements.
- Insertion sort, Bubble sort, and Merge sort are stable sorting algorithms.
- Insertion sort maintains the relative order of equal elements by inserting elements into their correct position without changing the order of equal elements.
- Bubble sort preserves the relative order of equal elements by repeatedly swapping adjacent elements to move larger elements to the end of the list.
- Merge sort maintains the relative order of equal elements by dividing the list into halves, sorting each half, and then merging the sorted halves while preserving the order of equal elements.
Last updated on Feb 20, 2025
-> A total number of 113 revised vacancies have been announced for the post of Scientific Assistant in Computer Science (CS), Information Technology (IT), and Electronics & Communication (EC) streams.
-> Online application form, last date has been extended up to from 17th April 2025.
->The NIELT has revised the Essential Qualifications for the post of Scientific Assistant. Candidates must possess (M.Sc.)/ (MS)/ (MCA) / (B.E.)/ (B.Tech) in relevant disciplines.
-> The NIELIT Scientific Assistant 2025 Notification has been released by the National Institute of Electronics and Information Technology (NIELIT).