Add bubble sort #8

Merged
cromer merged 16 commits from bubblesort into master 2018-11-11 19:17:20 -03:00
2 changed files with 21 additions and 0 deletions
Showing only changes of commit 9a29347198 - Show all commits

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