notes the sorted list is the elements of the merged list are task write program for merge sort quick sort in this method an array [ ], [nis sorted by picking some value in the array as key elementwe then swap the first element of the list with the key element so that the key will come in the first positionwe then find out the proper place of key in the list the proper place is that position in the list where if key is placed then all elements to the left of it are smaller than the keyand all the elements to the right of it are greater than the key to obtain the proper position of the key we traverse the list in both the directions using the indices and respectively we initialize to that index which is one more than the index of the key elementi if the list to be sorted is having the indices running from to nthen the key element is the at index mhence we initialize to ( + the index is incremented till we get an element at the ith position greater than the key value similarly we initialize to and go on decrementing till we get an element having the value less than the key value we then check whet her and have crossed each other if not then we interchange the elements at the ith and jth positionand continue the process of incrementing and decrementing till and crosses each other when and crosses each other we interchange the elements at the key position( at mth positionand the elements at the jth position this brings the key element at the jth positionand we find that the elements to left are less than and the elements to the right of it are greater than it therefore we can split the given list into two sub-lists the first one made of elements from mth position to the ( - )th positionand the second one made of elements from the ( + )th position to nth positionand repeat the same procedure with each of the sub-lists separately here is implementation void qsort(int []int mint nint key, , ,kif( nk getkeyposition(xmn)interchange(& [ ]& [ ])key [ ] =nwhile( jwhile(( < &( [ <key) ++while( > &( [ikey)lovely professional university