帮我看一下这段代码是什么语言int quickpass ( sqlist &R, int low, int high ) { R.elem[0] = R.elem[low]; pivotkey = R.elem[low].key;
时间: 2024-06-04 19:12:06 浏览: 85
It is difficult to determine the exact programming language without additional context or code. However, based on the provided snippet "int quickpass ( sqlist", it appears to be a function declaration in C or C++ that takes a parameter of type "sqlist".
相关问题
下面程序段的功能是实现一趟快速排序,请在下划线处填上正确的语句。 (7.3 P173) struct record {int key;datatype others;}; void quickpass(struct record r[], int s, int t, int &i) {int j=t; struct record x=r[s]; i=s; while(i<j) {while (i<j && r[j].key>x.key) j=j-1; if (i<j) {r[i]=r[j];i=i+1;} while (____________________) i=i+1; if (i<j) {r[j]=r[i];j=j-1;} }_________________; }
pivot) {
int i = s, j = t;
struct record temp;
while (i < j) {
while (i < j && r[j].key >= pivot) j--;
while (i < j && r[i].key <= pivot) i++;
if (i < j) {
temp = r[i];
r[i] = r[j];
r[j] = temp;
}
}
// 在下划线处填上正确的语句
quickpass(r, s, i - 1, pivot);
quickpass(r, i + 1, t, pivot);
}
答案:quickpass(r, i + 1, t, pivot);
阅读全文