diff --git "a/2101040022/chapter_9/ \346\225\260\347\273\204\344\270\255\347\232\204\347\254\254k\344\270\252\346\234\200\345\244\247\345\205\203\347\264\240.cpp" "b/2101040022/chapter_9/ \346\225\260\347\273\204\344\270\255\347\232\204\347\254\254k\344\270\252\346\234\200\345\244\247\345\205\203\347\264\240.cpp" new file mode 100644 index 0000000000000000000000000000000000000000..f07bb65c4afee2aa86c6f834f0617ba04a6460d8 --- /dev/null +++ "b/2101040022/chapter_9/ \346\225\260\347\273\204\344\270\255\347\232\204\347\254\254k\344\270\252\346\234\200\345\244\247\345\205\203\347\264\240.cpp" @@ -0,0 +1,33 @@ +class Solution { +public: + int part(vector& nums,int start,int end){ + int low=start,high=end; + int tmp=nums[start]; + while(low=tmp) + high--; + nums[low]=nums[high]; + while(low& nums,int start,int end,int k){ + if(startnums.size()-k){ + return quick_sort(nums,start,idx,k); + }else if(idx& nums, int k) { + return quick_sort(nums,0,nums.size()-1,k); + } +}; \ No newline at end of file