This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<iostream> | |
| using namespace std; | |
| template <class datatype> | |
| class StackInterface{ | |
| public: | |
| virtual void push(datatype data) = 0; | |
| virtual datatype peek() = 0; | |
| virtual void pop() = 0; | |
| virtual bool isEmpty() = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<iostream> | |
| using namespace std; | |
| template <class datatype> | |
| class Linkedlist{ | |
| Linkedlist* head; | |
| public: | |
| datatype data; | |
| Linkedlist* next; | |
| Linkedlist(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<iostream> | |
| using namespace std; | |
| class Sort{ | |
| public: | |
| static void swap(int& a, int &b){ | |
| int temp = a; | |
| a = b; | |
| b = temp; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<iostream> | |
| #include<stack> | |
| using namespace std; | |
| class PostfixEvaluator{ | |
| string expression; | |
| bool isOperator(char c){ | |
| if(c == '+' || c == '-' || c == '*' || c == '/') | |
| return true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<iostream> | |
| #include<stack> | |
| using namespace std; | |
| class PostfixConverter{ | |
| string infix; | |
| string postfix; | |
| bool isOperand(char C){ | |
| if(C >= '0' && C <= '9') return true; |
NewerOlder