function partition(num,begin,end){
var pivot= num[begin];
var beginning = begin-1 ;
var ending = end+1 ;
// over here the while loop says that the argument is true but,
// what is true, and how does this thing work
while (true) {
beginning++;
while ( beginning< end && num[beginning] < pivot)
beginning++;
ending--;
while (ending>begin && num[ending] > pivot)
ending--;
if (beginning < ending)
swap(num, beginning, ending);
else
return ending;
}
function swap(num, begin, end) {
var temp = num[begin];
num[begin] = num[end];
num[end] = temp;
}
関数パーティションのwhileループ、それは機能しますが、それがどのように機能し、コードがどれほど効率的かを知りたいです、ありがとう