c - c中的快速排序文件处理
问题描述
大家好,我是 c 编程的新手,我从一本书中得到了这段代码,我试图弄清楚这段代码是什么意思,谁能解释一下?谢谢
int partition (struct Data data[1000], int low, int high) {
int pivot = data[high].G3;
int i = (low - 1);
for (int j = low; j <= high- 1; j++) {
if (data[j].G3 > pivot) {
i++;
swap(&data[i], &data[j]);
}
}
swap(&data[i + 1], &data[high]);
return (i + 1);
}
解决方案
推荐阅读
- visual-studio-code - 您可以使用 VS Code 中的键盘在悬停弹出窗口中激活按钮吗?
- c++ - Windows 更新后 LoadImage 停止工作
- excel - IF语句中的Excel连接逻辑条件
- android - 不推荐使用 Espresso AccessibilityChecks 测试
- delphi - 在关闭另一个 MDI ChildForm 时启用 MDI ChildForm 的 TButton
- javascript - 在复选框上显示外部组件单击两个无状态组件之间
- python-3.x - 如何使用 csv.write 输出到 csv 文件并添加标头 - Python3/boto3
- c++ - C++ 库和自注册类:客户端应用程序中的工厂映射为空
- python - 为什么我可以使用 df.plot 创建绘图,然后通过调用 plt 对象修改我看到的绘图?
- javascript - 如何让 mapbox 地理编码 API 和等时 API 一起工作?