From 9a293471981e59affc34e3b0acd87d56511ddf8a Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Sun, 11 Nov 2018 16:49:23 -0300 Subject: [PATCH] add bubble sort documentation --- doc/Informe.tex | 12 ++++++++++++ doc/psuedo/bubblesort.txt | 9 +++++++++ 2 files changed, 21 insertions(+) create mode 100644 doc/psuedo/bubblesort.txt diff --git a/doc/Informe.tex b/doc/Informe.tex index 6521b74..fb352e7 100644 --- a/doc/Informe.tex +++ b/doc/Informe.tex @@ -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} diff --git a/doc/psuedo/bubblesort.txt b/doc/psuedo/bubblesort.txt new file mode 100644 index 0000000..c3cc70c --- /dev/null +++ b/doc/psuedo/bubblesort.txt @@ -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