Skip to content

Instantly share code, notes, and snippets.

View rajabishek's full-sized avatar

Raj Abishek rajabishek

View GitHub Profile
@rajabishek
rajabishek / stack.cpp
Last active August 29, 2015 14:06
Stack
#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;
@rajabishek
rajabishek / linkedList.cpp
Last active August 29, 2015 14:06
Linked List
#include<iostream>
using namespace std;
template <class datatype>
class Linkedlist{
Linkedlist* head;
public:
datatype data;
Linkedlist* next;
Linkedlist(){
@rajabishek
rajabishek / sorting.cpp
Last active August 29, 2015 14:06
Sorting
#include<iostream>
using namespace std;
class Sort{
public:
static void swap(int& a, int &b){
int temp = a;
a = b;
b = temp;
@rajabishek
rajabishek / postfixEvaluation.cpp
Last active August 29, 2015 14:06
Postfix Evaluation
#include<iostream>
#include<stack>
using namespace std;
class PostfixEvaluator{
string expression;
bool isOperator(char c){
if(c == '+' || c == '-' || c == '*' || c == '/')
return true;
@rajabishek
rajabishek / infixToPostfixConversion.cpp
Last active August 29, 2015 14:06
Infix To Postfix Convertion
#include<iostream>
#include<stack>
using namespace std;
class PostfixConverter{
string infix;
string postfix;
bool isOperand(char C){
if(C >= '0' && C <= '9') return true;