comparison example/many_task/ppe/QuickSort.cc @ 1851:637fa9a4105b draft

fix many_task ( sort )
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 21 Dec 2013 19:42:17 +0900
parents 9ccfdc408d51
children 7e9ebc1b08b6
comparison
equal deleted inserted replaced
1850:260c0956424d 1851:637fa9a4105b
79 int where = (begin + end) / 2; 79 int where = (begin + end) / 2;
80 int pivot = data[where].index; 80 int pivot = data[where].index;
81 data[where].index = data[begin].index; 81 data[where].index = data[begin].index;
82 int i; 82 int i;
83 p = begin; 83 p = begin;
84 for (i=begin+1; i<=end; i++) { 84 for (i=begin+1; i<end; i++) {
85 if (data[i].index < pivot) { 85 if (data[i].index < pivot) {
86 p++; 86 p++;
87 swap(data, p, i); 87 swap(data, p, i);
88 } 88 }
89 } 89 }