Question: / / main . cpp / / File: main.cpp #include StackQueue.h #include using namespace std; bool isPalindrome ( const string& str ) ; int

//main.cpp
// File: main.cpp
#include "StackQueue.h"
#include
using namespace std;
bool isPalindrome(const string& str);
int main(){
cout "No implementation given.";
return 0;
}// end main()
bool isPalindrome(const string& str){
/* Type your codee here. */
}
//StackQueue.h
// File: StackQueue.h
#ifndef STACK_QUEUE_H
#define STACK_QUEUE_H
/* class: Stack
* The class that defines a stack. Implemented
* using an array.
*/
class Stack {
public:
// Node * head = nullptr;
char items[200];
int top =-1;
char peek() const { return items[top]; }
bool isEmpty() const { return top ==-1; }
void push(const char data){
items[++top]= data;
}
char pop(){
return items[top--];
}
};
/* class: Queue
* The class that defines a stack. Implemented
* using an array.
*/
class Queue {
public:
char items[100];
int back =-1;
char peek() const { return items[0]; }
bool isEmpty() const { return back ==-1; }
void enqueue(const char data){
items[++back]= data;
}
char dequeue(){
char data = items[0];
for (int i =1; i = back; i++){
items[i -1]= items[i];
}
back -=1;
return data;
}
};
#endif
/ / main . cpp / / File: main.cpp #include

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!