12   Articles
12
W

# Why Quick Sort preferred for Arrays and Merge Sort for Linked Lists?

0 26
0 26

Why Quick Sort preferred for Arrays and Merge Sort for Linked Lists? – Searching and Sorting – Quick Sort in its general form is an in-place sort. whereas merge sort requires O(N) extra storage, N denoting the array size which may be quite expensive.

Q

# QuickSort on Doubly Linked List

0 34
0 34

QuickSort on Doubly Linked List – Searching and sorting -. The idea is simple, we first find out pointer to last node. Once we have pointer to last node, we can recursively sort the linked list using pointers to first and last nodes of linked list.

I

# Iterative Quick Sort

0 23
0 23

Iterative Quick Sort – Searching and Sorting – Partition process is same in both recursive and iterative. The same techniques to choose optimal pivot can also be applied to iterative version.

W

# When does the worst case of Quicksort occur?

0 19
0 19

When does the worst case of Quicksort occur? – Searching and sorting – Since these cases are very common use cases, the problem was easily solved by choosing either a random index for the pivot.

S

# Stability in sorting algorithms

0 12
0 12

stability in sorting algorithms – Searching and Sorting – Some sorting algorithms are stable by nature like Insertion sort, Merge Sort, Bubble Sort, etc. And some sorting algorithms are not, like Heap Sort, Quick Sort.

S

# ShellSort

0 4
0 4

ShellSort – Searching and Sorting – ShellSort is mainly a variation of Insertion Sort. In insertion sort, we move elements only one position ahead. When an element has to be moved far ahead, many movements are involved.

0 24

Bucket Sort – Searching and sorting – A simple way is to apply a comparison based sorting algorithm. The lower bound for Comparison based sorting algorithm (Merge Sort, Heap Sort, Quick-Sort .. etc) is Ω(n Log n), i.e., they cannot do better than nLogn.