sorting: non-recursive quicksort
stacks: empty check and init