Chapter 7 · Class 12 · CBSE · Science Computer Science
Sorting
25 practice questions · 5 marks weightage
Topics in this chapter
- Python Sorting Tools
- Selection Sort Logic
- Insertion Sort Logic
- Bubble Sort Logic
- Sorting Analysis And Correctness
Cheat sheet
Cheat SheetPractice questions
- Question 1Q-2625C0See the answer and solution
Which statement correctly describes the difference between list.sort() and sorted() in Python?
- A.list.sort() returns a new sorted list, while sorted() changes the original list.
- B.list.sort() changes the original list, while sorted() returns a new sorted list.
- C.Both list.sort() and sorted() always change the original list.
- D.Neither list.sort() nor sorted() can arrange a list in descending order.
- Question 2Q-BE9757See the answer and solution
A single left-to-right pass of bubble sort is performed in ascending order on the list [7, 2, 5, 3, 1]. What will the list be after this pass?
- A.[1, 2, 3, 5, 7]
- B.[2, 5, 3, 1, 7]
- C.[2, 3, 5, 1, 7]
- D.[7, 2, 5, 3, 1]
- Question 3Q-445B2ASee the answer and solution
For an already sorted list of n elements, explain why insertion sort can be more efficient than selection sort, and state the best-case time complexity of each algorithm.
- Question 4Q-91B611See the answer and solution
In an ascending selection sort, what will the list [64, 25, 12, 22, 11] become after the first pass?
- A.[11, 25, 12, 22, 64]
- B.[25, 64, 12, 22, 11]
- C.[12, 25, 64, 22, 11]
- D.[64, 25, 12, 11, 22]
- Question 5Q-188242See the answer and solution
Which combination correctly describes the standard in-place selection sort for a list of n elements?
- A.It performs Θ(n) comparisons and uses Θ(n) extra space.
- B.It performs Θ(n²) comparisons and uses O(1) auxiliary space.
- C.It performs Θ(n log n) comparisons and uses O(log n) auxiliary space.
- D.It performs Θ(n²) comparisons and uses Θ(n) auxiliary space.
20 more questions on Sorting
Sign up free to practise the full chapter. Questions you get wrong come back until you've mastered them.
Start practising freeFree to start · No credit card needed