fix: Remove unnecessary if in Search[While] algorithm

This commit is contained in:
Samuel Ortion 2024-03-08 08:00:05 +01:00
parent d417d52d76
commit 9c743d6484
3 changed files with 28 additions and 33 deletions

View File

@ -34,12 +34,9 @@
\caption{Search an element in an array using a while loop (bis)} \caption{Search an element in an array using a while loop (bis)}
\begin{algorithmic}[1] \begin{algorithmic}[1]
\Function{Search}{A: Array(n), E: element} \Function{Search}{A: Array(n), E: element}
\Comment{Version prefered by the professor} \Comment{Version ``preffered" by the professor}
\State $i \gets 0$ \State $i \gets 0$
\While {$i < n$ and $A[i] \neq E$} \While {$i < n$ and $A[i] \neq E$}
\If {A[i] $ = $ E}
\State \Return \True
\EndIf
\State $i \gets i + 1$ \State $i \gets i + 1$
\EndWhile \EndWhile
\If {$i = n$} \If {$i = n$}

BIN
main.pdf

Binary file not shown.

View File

@ -80,8 +80,6 @@
\input{content/chapters/include} \input{content/chapters/include}
\chapter{}
% \input{content/conclusion} % \input{content/conclusion}