Quick Sort with first element as pivot
Quicksort doesn't swap the pivot into its correct position in that way, but it lies on the hypothesis that each recursive call sorts the sub-array and then merging sorted sub-arrays would provide a completely sorted array:


let $V$ be the array to sort
$pivot \leftarrow pick()$ picks a pivot, in your case it's always the first element in $V$
let $V_{\lt}$ be a list $s.t. \forall a \in V_{\lt} \  a \in V \ \wedge \ a \lt pivot$
let $V_{=}$ be a list $s.t. \forall a \in V_{=} \  a \in V \ \wedge \ a = pivot$
let $V_{\gt}$ be a list $s.t. \forall a \in V_{\gt} \  a \in V \ \wedge \ a \gt pivot$


Quicksort then proceeds recursively calling itself on $V_{\lt}$ and $V_{\gt}$, thus assuming to get those two back with their values sorted.

The final step is then to return the concatenation of $V_{\lt}$, $V_{=}$ and $V_{\gt}$, in this order.

Providing a numerical example:

$V = [17, -10, 7, 19, 21, 23, -13, 31, 59]$

Steps:


Initial run

$pivot = 17$

$V_{\lt} = [-10, 7, -13] $

$V_{=} = [17] $

$V_{\gt} = [19, 21, 23, 31, 59] $
Recursion on $V_{\lt} = [-10, 7, -13] $

$pivot = -10$

$V_{\lt} = [-13] $

$V_{=} = [-10] $

$V_{\gt} = [7] $

skips recursion on $V_{\lt}$ and $V_{\gt}$ since they're of size 1, thus already sorted

returns $V_{sort}$ = concatenation of $V_{\lt}$, $V_{=}$ and $V_{\gt}$ = $[-13, -10, 7]$
Recursion on $V_{\gt} = [19, 21, 23, 31, 59] $

$pivot = 19$

$V_{\lt} = [] $

$V_{=} = [19] $

$V_{\gt} = [21, 23, 31, 59] $
Recursion on $V_{\gt} = [21, 23, 31, 59] $

$pivot = 21$

$V_{\lt} = [] $

$V_{=} = [21] $

$V_{\gt} = [23, 31, 59] $
Recursion on $V_{\gt} = [23, 31, 59] $

$pivot = 23$

$V_{\lt} = [] $

$V_{=} = [23] $

$V_{\gt} = [31, 59] $
Recursion on $V_{\gt} = [31, 59] $

$pivot = 31$

$V_{\lt} = [] $

$V_{=} = [31] $

$V_{\gt} = [59] $

returns $V_{sort}$ = concatenation of $V_{\lt}$, $V_{=}$ and $V_{\gt}$ = $[31, 59]$
Back from recursion in 5.

returns $V_{sort}$ = concatenation of $V_{\lt}$, $V_{=}$ and $V_{\gt}$ = $[23, 31, 59]$
Back from recursion in 4.

returns $V_{sort}$ = concatenation of $V_{\lt}$, $V_{=}$ and $V_{\gt}$ = $[21, 23, 31, 59]$
Back from recursion in 3.

returns $V_{sort}$ = concatenation of $V_{\lt}$, $V_{=}$ and $V_{\gt}$ = $[19, 21, 23, 31, 59]$
Back from recursion in 2.

returns $V_{sort}$ = concatenation of $V_{\lt}$, $V_{=}$ and $V_{\gt}$ = $[-13, -10, 7, 21, 23, 31, 59]$


As you can see, from the step 3 and onwards, the chosen pivot isn't an optimal one, since there only are elements at its right, preventing the algorithm to run in optimal time of $\mathcal{O}(n log_2 n)$

EDIT: following Kai's comment, I fixed the definitions of $V_{\lt}$, $V_{=}$ and $V_{\gt}$. I also acknowledge this is the simpler and less efficient Lomuto's partition.