add bubble sort documentation

This commit is contained in:
Chris Cromer 2018-11-11 16:49:23 -03:00
parent 2419f57c8c
commit 9a29347198
Signed by: cromer
GPG Key ID: 39CC813FF3C8708A
2 changed files with 21 additions and 0 deletions

View File

@ -12,6 +12,17 @@
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm,a4paper]{geometry}
\usepackage{amsmath}
\usepackage{listings}
\lstset{
basicstyle=\footnotesize\ttfamily,
columns=flexible,
breaklines=true
}
\usepackage{hyperref}
\hypersetup{pdftex,colorlinks=true,allcolors=black,bookmarks}
\usepackage{hypcap}
\pretitle{%
\begin{center}
\LARGE
@ -59,6 +70,7 @@ Xavier Canales
\subsection{Quick Sort}
\subsection{Bubble Sort}
\lstinputlisting{psuedo/bubblesort.txt}
\subsection{Bitonic Sort}

View File

@ -0,0 +1,9 @@
cuentaDeElementos := n
repetir
haCambiado := falso
disminuir cuentaDeElementos
repetir con indice desde 1 a cuentaDeElementos
if (elemento en indice) > (elemento en (indice + 1))
intercambiar (elemento en indice) con (elemento en (indice + 1))
haCambiado := falso
hasta haCambiado = verdad