我正在阅读荷兰国旗问题,但无法理解C++实现中函数low和high参数是什么threeWayPartition.
low
high
threeWayPartition
如果我将它们视为要排序的数组的最小和最大元素,那么if和else if语句没有任何意义,因为(data[i] < low)并且(data[i] > high)总是返回零.
if
else if
(data[i] < low)
(data[i] > high)
我哪里错了?
algorithm partitioning
algorithm ×1
partitioning ×1