edited by
796 views
0 votes
0 votes

Please correct if any of the point is wrong :

Quicksort:
1.Need more random accesses

2 Used when Random access is fast (hence preferred on array and not on Linked List)

2 No extra space needed ==> Inplace

4 Not a stable sorting algorithm

5 even in worst case using randomized quick sort (O(n^2)

MergeSort:

1 Need Less random accesses than quicksort

2 Preferred When random access is very slow(On linked list)

3 why Not preferred for array over quicksort ?? ==> Extra space needed auxillary array O(N)

4 Extra space needed when applied on Array | No extra space needed when applied on Linked List

4 Stable sorting algo

Somone please explain this point its from geeksforgeeks:

Quicksort in particular exhibits good cache locality and this makes it faster than merge sort in many cases like in virtual memory environment.

edited by

Please log in or register to answer this question.

Related questions

0 votes
0 votes
1 answer
2
LavTheRawkstar asked Jan 12, 2017
840 views
INSERTION-SORT (A, n) ⊳ A[1 . . n]for (j ← 2 to len(A) ){key ← A[ j];i ← j – 1 ; while (i 0 and A[i] key) { A[...
0 votes
0 votes
0 answers
4