The palindrome-recognition algorithm checks for an empty queue but not an empty stack. Why is this check sufficient?
What will be an ideal response?
Although the whileloop checks only the queue, both the stack and the queue contain the same number of characters at the beginning and the end of each repetition of the loop. If the queue is empty, the stack will be empty, too.
Computer Science & Information Technology
You might also like to view...
MC In a(n)______ , the body of a while structure never stops executing.
a) syntax error. b) fatal error. c) infinite loop. d) None of the above.
Computer Science & Information Technology
You use a(n) ____ to specify both the records to select in a dataset and the order in which to arrange the records.
A. query B. question C. inquiry D. access
Computer Science & Information Technology