## Invitation to Computer Science 8th Edition

$\bullet$ Set value of Previous to 0 $\bullet$ Set value of $V$ to the first element of the list $\bullet$ Set the value of Exists to $N O$ $\bullet$ While both $(V \geq-1)$ and (Exists $=N O )$ do $\bullet \quad$ Set value of Previous to $V$ $\bullet \quad$ Set value of $V$ to next element from the list $\bullet\quad$ If Previous $=V$ then $\bullet\quad\quad$ Set Exists to $Y E S$ $\bullet$ End of loop. $\bullet$ Print value of Exists
$\bullet$ Set value of Previous to 0 $\bullet$ Set value of $V$ to the first element of the list $\bullet$ Set the value of Exists to $N O$ $\bullet$ While both $(V \geq-1)$ and (Exists $=N O )$ do $\bullet \quad$ Set value of Previous to $V$ $\bullet \quad$ Set value of $V$ to next element from the list $\bullet\quad$ If Previous $=V$ then $\bullet\quad\quad$ Set Exists to $Y E S$ $\bullet$ End of loop. $\bullet$ Print value of Exists