## 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\quad\quad$ Set value of Number to $V$ $\bullet$ End of loop. $\bullet$ If Exists $=Y E S$ then $\bullet \quad$ Print "Yes, the numbers Number and Number are adjacent" $\bullet$ Else $\bullet\quad$ Print "No, there are not"
$\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\quad\quad$ Set value of Number to $V$ $\bullet$ End of loop. $\bullet$ If Exists $=Y E S$ then $\bullet \quad$ Print "Yes, the numbers Number and Number are adjacent" $\bullet$ Else $\bullet\quad$ Print "No, there are not"