Quick sort and merge sort algorithms
Elucidate quick sort and merge sort algorithms?
Expert
Quick sort uses the ‘conquer and divide’ concept by dividing list of elements in two sub elements The process is illustrated below:
1. Pick an element, pivot, from list.
2. Rearrange elements in list, so that all elements those are less than the pivot are arranged before pivot and all elements those are greater than the pivot are arranged after pivot. Now the pivot is in it position.
3. Sort the both sub lists – sub list of the elements that are less than the pivot and the list of elements that are more than the pivot recursively.
Merge Sort: A comparison based sorting algorithm. The input order is preserved in sorted output.
Merge Sort algorithm is illustrated below:
1. The length of list is 0 or 1, and then it is considered as sorted.
2. Otherwise, divide unsorted list in 2 lists each about half the size.
3. Sort each sub list recursively. Implement the step 2 till the two sub lists are sorted.
4. as a final step, combine (merge) both the lists back in one sorted list.
Illustrates the memory management in the operating system?
Define in detail the term Disjoint set.
Explain the difference between a stack and a Queue.
Explain how the Doubly Linked List associated with the Circular Linked List?
When should we use Space in linked list instead of an array or vice versa?
What do you mean by sequential search? Find out the average number of comparisons in the sequential search?
Explain the alternative systems within RTOS for responding a hardware source call.
Explain about the priority queue?
Write down a brief note on the term recursive algorithm?
What is a Fibonacci Search?
18,76,764
1932389 Asked
3,689
Active Tutors
1426661
Questions Answered
Start Excelling in your courses, Ask an Expert and get answers for your homework and assignments!!