From ac01470812b5e2b9d12ef042c5297659277181a6 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Mon, 19 Nov 2018 15:10:56 -0300 Subject: [PATCH] update bubble sortin informe --- doc/Informe.tex | 9 ++++++--- doc/pseudo/bubblesort.txt | 12 ++++++++++++ doc/psuedo/bubblesort.txt | 9 --------- 3 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 doc/pseudo/bubblesort.txt delete mode 100644 doc/psuedo/bubblesort.txt diff --git a/doc/Informe.tex b/doc/Informe.tex index 910bc03..3ca06df 100644 --- a/doc/Informe.tex +++ b/doc/Informe.tex @@ -16,7 +16,10 @@ \lstset{ basicstyle=\small\ttfamily, columns=flexible, - breaklines=true + breaklines=true, + inputencoding=utf8, + extendedchars=true, + literate={á}{{\'a}}1 {é}{{\'e}}1 {í}{{\'i}}1 {ó}{{\'o}}1 {ú}{{\'u}}1 {ñ}{{\~n}}1 {Á}{{\'A}}1 {É}{{\'E}}1 {Í}{{\'I}}1 {Ó}{{\'O}}1 {Ú}{{\'U}}1 {Ñ}{{\~N}}1 } \usepackage{hyperref} @@ -63,14 +66,14 @@ Xavier Canales \newpage \pagenumbering{arabic} -\section{Psuedo código} +\section{Pseudo código} \subsection{Merge Sort} \subsection{Quick Sort} \subsection{Bubble Sort} -\lstinputlisting{psuedo/bubblesort.txt} +\lstinputlisting{pseudo/bubblesort.txt} \subsection{Bitonic Sort} diff --git a/doc/pseudo/bubblesort.txt b/doc/pseudo/bubblesort.txt new file mode 100644 index 0000000..04866c8 --- /dev/null +++ b/doc/pseudo/bubblesort.txt @@ -0,0 +1,12 @@ +entrada: array: arreglo de elementos enteros; n: tamaño del arreglo +salida: arreglo array ordenado ascendentemente. +cuentaDeElementos := n +repetir + haCambiado := falso + disminuir cuentaDeElementos + repetir con indice desde 1 a cuentaDeElementos + if (array en indice) > (array en (indice + 1)) + intercambiar (array en indice) con (array en (indice + 1)) + haCambiado := falso +hasta haCambiado = verdad +retorna array diff --git a/doc/psuedo/bubblesort.txt b/doc/psuedo/bubblesort.txt deleted file mode 100644 index c3cc70c..0000000 --- a/doc/psuedo/bubblesort.txt +++ /dev/null @@ -1,9 +0,0 @@ -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