Solution :
check_palindrome
lower_
_string
string
_lower()
Let stack = new Stack()
Let queue = new Queue();
for each character c in lower_case_string:
stack.push(c);
queue.enqueue(c);
let isPalindrome = true;
while queue is not empty {
if (queue.remove().equals(stack.pop())) {
continue;
} else {
isPalindrome=false;
break while loop;
}
}
return isPalindrome
Input = aabb
output = true
input =abcd
output = false
Answer:
Both are correct.
Explanation:
Both technicians are correct in this scenario. Technician A point of view is correct as well as technician B.
Answer:
cin >> name;
cout << "Greetings, " << name << "!!!" << '\n';
Explanation:
Answer:
10
Explanation:
An enqueue operation is a function that adds an element(value) to a queue array. A dequeue operations removes an element from a queue array. Queue arrays follow a first-in-first-out approach, so elements that are first stored in the queue are removed/accessed first(enqueue operations add elements at the rear of the queue array).
The following operations leave 10 elements in the queue of array size 12 after its done:
10 enqueue operations= adds 10 elements
5 dequeue operations= removes 5 elements( 5 elements left in queue)
6 enqueue operations= adds 6 elements(11 elements in queue)
10 dequeue operations= removes 10 elements(1 element left in queue)
8 enqueue operations= adds 8 elements(9 elements in queue)
2 dequeue operations= removes 2 elements(7 elements left in queue)
3 enqueue operations= adds 3 elements(10 elements in queue)
Therefore there are 10 elements in the queue after enqueue and dequeue operations.
Answer: Please see below as the answer is self-explanatory
Explanation:
Digital phones, normally uses a keyboard, with the digits 0-9, and special characters like # and *.
When the caller presses any keyboard, an electronic circuit within the phone generates two pure sinusoids, of frequencies within the vocal bandwidth (between 300 Hz and 3 khz, roughly), which identifies uniquely (as decoded by the receiving switch) which was the key pressed.
In this way, the switch reconstructs the phone number called, separating country code, area code and the local number as it receives the tones.
This system is called DTMF (dual tone multi frequency).