Sir, can I know where are the lectures of quick sort and merge sort?
Quick sort and Merge sort
Qucik sort
Merge Sort
The third test case is passing in https://ide.codingblocks.com/s/55203
but not with https://ide.codingblocks.com/s/55202
and shows TLE with https://ide.codingblocks.com/s/55206
although I have used randomization in all of them.
Please explain
Question is ---------
QUICKSORT
Given an array A, of N elements. Sort the array using quicksort algorithm.(Note : Use randomized quicksort, otherwise worst case will not pass).
Input Format:
A single integer, N, denoting the number of elements in array. Next line contains N integers, denoting the elements of array.
Constraints:
1<=N<=2*10^5 |Ai|<=10^9
Output Format
Print in a single line, N spaced integers, denoting the elements of array A in sorted order.
Sample Input
5
3 6 4 1 2
Sample Output
1 2 3 4 6
C++
Download Testcases
Unlock Editorial
Submit Code
Custom Input
Run Code
Output :