Partitioning only for quicksort

Given an array ar and a number p, partition the array, so that all elements greater than p are to the right of it and all the numbers smaller than p are to its left