PROBLEM SET
划分操作
按知识点筛选题目,系统巩固该考点。
题目列表
共 2 题
A18413
下面代码段实现了快速排序的划分操作(以首元素为基准),横线处代码应填入( )。int partition(vector<int>& arr, int low, int high) { int pivot = arr[low]; int i = low, j = high; while (i < j) { while (i < j && arr[j] >= pivot) j--; while (i…
C-L5
困难
--
A18702
下面代码段实现了快速排序的划分操作(以首元素为基准),横线处代码应填入( )。def partition(arr, low, high): pivot = arr[low] i = low j = high while i < j: while i < j and arr[j] >= pivot: j -= 1 while i < j and arr[i] <= pivot: i += 1 if…
Python-L5
困难
--