Describe how you would use a queue and a stack to evaluate if a string is a palindrome.
What will be an ideal response?
As you traverse a string from left to right, you can add each character to both a queue and a stack. Now pop characters off the stack and dequeue characters off the queue. If each pair is the same, you have a palindrome.
You might also like to view...
A ________ variable is declared outside all functions.
A) local B) global C) static D) counter E) constant
Using good grammar, describe two ways to connect two monitors to a single computer
What will be an ideal response?
While responding to an incident on a Linux server, the administrator needs to disable unused services. Which of the following commands can be used to see processes that are listening on a TCP port?
A. Lsof B. Tcpdump C. Top D. Ifconfig
The sorted array-based implementation of the tableInsert operation is ______.
a) O(1) b) O(log n) c) O(n) d) O(n2)