F. Quick Sort(3154) Description Given a positive integer sequence, no more than 5000. Design a function to do Quick sort
Posted: Mon May 09, 2022 6:27 am
i need a code for this practice by using C++ language
F. Quick Sort(3154) Description Given a positive integer sequence, no more than 5000. Design a function to do Quick sorting on it(ascending). Then print out sorted list. Take the middle of list as the pivot Input First line enter a number(n) Second line enters n integers Output Output the sorted array, 10 number each line separated by one space. Last line maybe has less than 10 number Examples input 复制 20 18 13 36 15 42 10 3 5 9 12 8 28 21 25 30 31 45 23 19 11 output 3 5 8 9 10 11 12 13 15 18 19 21 23 25 28 30 31 36 42 45 input 15 78 34 62 5 76 23 56 72 51 34 52 37 58 82 54 76 output 复制 5 23 34 34 37 51 52 54 56 58 62 72 76 78 82
F. Quick Sort(3154) Description Given a positive integer sequence, no more than 5000. Design a function to do Quick sorting on it(ascending). Then print out sorted list. Take the middle of list as the pivot Input First line enter a number(n) Second line enters n integers Output Output the sorted array, 10 number each line separated by one space. Last line maybe has less than 10 number Examples input 复制 20 18 13 36 15 42 10 3 5 9 12 8 28 21 25 30 31 45 23 19 11 output 3 5 8 9 10 11 12 13 15 18 19 21 23 25 28 30 31 36 42 45 input 15 78 34 62 5 76 23 56 72 51 34 52 37 58 82 54 76 output 复制 5 23 34 34 37 51 52 54 56 58 62 72 76 78 82