Chapter 2: Problem 25
Write an algorithm to read in a sequence of values \(V \geq 0\), one at a time, and determine if the list contains at least one adjacent pair of values that are identical. The end of the entire list is marked by the special value \(V=-1\). For example, if you were given the following input: \(14,3,7,7,9,1,804,22,-1\) the output of your algorithm should be a 'Yes' because there is at least one pair of adjacent numbers that are equal (the 7s). However, given the following input: \(14,3,7,77,9,1,804,22,-1\) the output of your algorithm should be a 'No' because there are no adjacent pairs that are
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.