1. A straightforward approach is to use a second queue, called line. As the input is being read, each character is placed in the line queue (as well as being placed in the original stack and queue). During the comparison phase, we also keep track of how many characters correctly match. If a mismatch occurs, we can then print an appropriate amount of the line queue as part of the error message.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here