Computer Science EngineeringEasy
Which of the following standard sorting algorithms is stable?
- A. Quick sort
- B. Heap sort
- C. Merge sort
- D. Selection sort
Correct answer: C. Merge sort
Merge sort preserves the relative order of equal keys when merging, while the others can reorder them.
Practise more Algorithms, Data Structures & Programming (ISRO CS) questionsAlgorithms, Data Structures & Programming (ISRO CS): notes and key points
More Algorithms, Data Structures & Programming (ISRO CS) questions
- In a max-heap, the largest element is always located at
- A simple undirected graph has 10 vertices and exactly 3 connected components. What is the maximum possible number of edges?
- How many distinct spanning trees does the complete graph K4 have?
- The best-case running time of insertion sort (already sorted input) is
- The recurrence T(n) = T(sqrt(n)) + 1 has the solution
- Prim's algorithm on a graph stored as an adjacency matrix with a simple array for minimum selection runs in