diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..470aa0e Binary files /dev/null and b/.DS_Store differ diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000..9b761ab Binary files /dev/null and b/src/.DS_Store differ diff --git a/src/lab/.DS_Store b/src/lab/.DS_Store new file mode 100644 index 0000000..241e52e Binary files /dev/null and b/src/lab/.DS_Store differ diff --git a/src/lab/exp3/quick_pscode.txt b/src/lab/exp3/quick_pscode.txt index d76fcce..55267c9 100644 --- a/src/lab/exp3/quick_pscode.txt +++ b/src/lab/exp3/quick_pscode.txt @@ -1,2 +1,29 @@ -quick sort - +Quick Sort- pseudo code + + +Quicksort(A,p,r) { + if (p < r) { + q <- Partition(A,p,r) + Quicksort(A,p,q) + Quicksort(A,q+1,r) + } +} + + + +Partition(A,p,r) + x <- A[p] + i <- p-1 + j <- r+1 + while (True) { + repeat + j <- j-1 + until (A[j] <= x) + repeat + i <- i+1 + until (A[i] >= x) + if (i A[j] + else + return(j) + } +}