Skip to content

Instantly share code, notes, and snippets.

View Himanshu3198's full-sized avatar
🎯
Focusing

HIMANSHU SHARMA Himanshu3198

🎯
Focusing
View GitHub Profile
@mycodeschool
mycodeschool / BalancedParentheses.cpp
Created October 29, 2013 00:49
C++ Program to check for balanced parentheses in an expression using stack.
/*
C++ Program to check for balanced parentheses in an expression using stack.
Given an expression as string comprising of opening and closing characters
of parentheses - (), curly braces - {} and square brackets - [], we need to
check whether symbols are balanced or not.
*/
#include<iostream>
#include<stack>
#include<string>
using namespace std;
/*
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>
/* Binary tree - Level Order Traversal */
#include<iostream>
#include<queue>
using namespace std;
struct Node {
char data;
Node *left;
Node *right;
};
/* Merge sort in C */
#include<stdio.h>
#include<stdlib.h>
// Function to Merge Arrays L and R into A.
// lefCount = number of elements in L
// rightCount = number of elements in R.
void Merge(int *A,int *L,int leftCount,int *R,int rightCount) {
int i,j,k;
/* Deleting a node from Binary search tree */
#include<iostream>
using namespace std;
struct Node {
int data;
struct Node *left;
struct Node *right;
};
//Function to find minimum in a tree.
Node* FindMin(Node* root)
@jayaprasad37
jayaprasad37 / queueimplementationusingarray.cpp
Last active January 31, 2021 18:23
Queue implementation using array
#include <iostream>
#include <string.h>
#include <typeinfo>
using namespace std;
#define MAX 5 //preprossor for array size
int myarray[MAX]; //array for the queue
int count = 0; //count to check the status of the queue
int front =-1; //front index
int rear =-1; //rear index
int isempty() //function to see if the queue is empty or not
@shubham100795
shubham100795 / findceilfloor.cpp
Created March 2, 2017 14:13
Find ceil and floor of a key in BST
#include<iostream>
#include<cstdlib>
using namespace std;
struct node{
int data;
struct node *left;
struct node *right;
};
@cruiz24
cruiz24 / circleQ.cpp
Last active February 1, 2021 17:50
Implementation of Circular Queue using C++
Implementation using C++ programming
#include <iostream>
#define SIZE 5 /* Size of Circular Queue */
using namespace std;
class Queue {
private:
int items[SIZE], front, rear;
// Program to find minimum number of platforms
// required on a railway station
#include<iostream>
#include<algorithm>
using namespace std;
// Returns minimum number of platforms reqquired
int findPlatform(int arr[], int dep[], int n)
{
// A Stack based C++ program to find next
// greater element for all array elements.
#include <bits/stdc++.h>
using namespace std;
/* prints element and NGE pair for all
elements of arr[] of size n */
void printNGE(int arr[], int n) {
stack < int > s;