Skip to content

Instantly share code, notes, and snippets.

View manjeet13's full-sized avatar
🎯
Focusing

Manjeet Kumar manjeet13

🎯
Focusing
  • Bengaluru
View GitHub Profile
@mycodeschool
mycodeschool / InfixToPostfix.cpp
Created December 9, 2013 05:34
Infix to Postfix conversion in C++ using stack. We are assuming that both operators and operands in input will be single character.
/*
Infix to postfix conversion in C++
Input Postfix expression must be in a desired format.
Operands and operator, both must be single character.
Only '+' , '-' , '*', '/' and '$' (for exponentiation) operators are expected.
*/
#include<iostream>
#include<stack>
#include<string>
/*
Evaluation Of postfix Expression in C++
Input Postfix expression must be in a desired format.
Operands must be integers and there should be space in between two operands.
Only '+' , '-' , '*' and '/' operators are expected.
*/
#include<iostream>
#include<stack>
#include<string>
@mycodeschool
mycodeschool / Stack_ArrayImplementation_OOP.cpp
Created October 8, 2013 02:44
An object oriented implementation of stack using arrays in C++.
// Stack - Object oriented implementation using arrays
#include <iostream>
using namespace std;
#define MAX_SIZE 101
class Stack
{
private:
int A[MAX_SIZE]; // array to store the stack
int top; // variable to mark the top index of stack.
@JeffSackmann
JeffSackmann / createTuple.py
Created January 13, 2011 19:59
turn a .csv file into a 2-dimensional python matrix (an array of arrays)
# turn a .csv file into a 2-dimensional python matrix (a list of lists)
# this will not make you happy if cells have commas in them, however escaped they may be
# reverse the process (go from matrix to .csv) with gist: 778484
def fixText(text):
row = []
z = text.find(',')
if z == 0: row.append('')