tikztikz

Algorithm 1 Quicksort

1procedure Quicksort(A,p,rA, p, r)

2if p<rp < r then

3q←q \gets Partition(A,p,RA, p, \R)

4Quicksort(A,p,q−1A, p, q - 1)

5Quicksort(A,q+1,rA, q + 1, r)

6procedure Partition(A,p,rA, p, r)

7x←A[r]x \gets A[r]

8i←p−1i \gets p - 1

9for j←pj \gets p to r−1r - 1 do

10if A[j]<xA[j] < x then

11i←i+1i \gets i + 1

12exchange A[i]A[i] with A[j]A[j]

13exchange A[i]A[i] with A[r]A[r]




observacioen: underset/overset solo funciones con caracteres o expresiones entre parentesis. underbrace no funciona.