Problem statement is to create a set of stacks that acts like a pile of plates. Pile of plates can withstand certain height. When it can't withstand we have to create a new set. Implement similar behavior in the code for stack. Use template to implement type independent stack. #include <iostream> #include "vector" #include "string" using namespace std; template<typename a> class setofStacks{ vector<a> setofStacks; int sizeofEachStack; public: void push(a value); a pop(); a popAt(int index); }; template<typename a> void setofStacks<a>::push(a value){ setofStacks.push_back(value); } template<typename a> a setofStacks<a>::pop(){ a val = setofStacks.back(); setofStacks.pop_back(); return val; } template<typename a> a setofStacks<a>::popAt(int inde...
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. *******************************************************************************/ #include <iostream> using namespace std; struct LinkedlistNode{ LinkedlistNode *next; int val; }; int main() { LinkedlistNode *n1 = new LinkedlistNode(); n1->val = 3; LinkedlistNode *n2 = new LinkedlistNode(); n2->val = 5; n1->next = n2; LinkedlistNode *n3...