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.
Define does the minimum spanning tree of a graph provide the shortest distance among any two given nodes.
Write down the various types of matrix operations?
A Linked List Instead Of an Array When Should You Use?
Explain about linked list?
Elucidate any two merits using Single linked list over doubly linked list and vice-versa?
Explain about the direct call to ISR by an interrupting source.
Elucidate the three applications in that stacks are employed?
What do you mean by the term matrix? Describe its uses with an illustration.
Explain the way of searching for data in a linked list.
What are the uses of binary tree?
18,76,764
1927686 Asked
3,689
Active Tutors
1423734
Questions Answered
Start Excelling in your courses, Ask an Expert and get answers for your homework and assignments!!