open navigation menu
AiFolder
Tools for a smarter you
Discover
Tools
AI
Games
Interviews
Blog
More
Search AiFolder
Toggle theme
Toggle theme
Sign in
Exit
00:00
Submit test
Sorting · Intermediate
10 questions · Question 1 of 10
10%
Multiple Choice
Mid
Why would you use Merge Sort for a Linked List?
A
Merge sort is often preferred for sorting a linked list.
B
The brute force solution will be to sort the array in O(n log n) time complexity and take the last 100 numbers but you can do better.
C
Only a few items: Insertion Sort Items are mostly sorted already: Insertion Sort Concerned about worst case scenarios: Heap Sort Interested in a good average case result: Quick Sort Items are drawn from a dense univer...
D
In Bubble sort, you know that after k passes, the largest k elements are sorted at the k last entries of the array, so the conventional Bubble sort uses: public static void bubblesort(int[] a) { for (int i = 1; i < a....
Previous
Next