Process Analysis Toolkit (PAT) 3.5 Help |
Concurrent Quicksort is a variant of classic quicksort algorithm which
emphasizes its concurrent perspective. globalvar
arr=Array(3){arr.set(0,3)>>arr.set(1,2)>>arr.set(2,1)} The above defines a global variable arr of type array, which has [3,2,1] as
its initial value. The above defines the quicksoft function. Its details can be found at
[AQDKJM09]. quicksort(arr) The above input the global variable arr for quicksorting. #define sorted (arr.get(0)<arr.get(1) &&
arr.get(1)<arr.get(2)) The above defines a condition named as sorted which represents the situation
where the number in the array is sorted in ascending order. #assert System |= (<>sorted) &&
(sorted->[]sorted); The assertion above specifies that eventually the array will be sorted, and
once the array is sorted it will remain sorted.