Skip to content

Instantly share code, notes, and snippets.

View Himanshu3198's full-sized avatar
🎯
Focusing

HIMANSHU SHARMA Himanshu3198

🎯
Focusing
View GitHub Profile
@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
/* 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)
/* 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;
/* Binary tree - Level Order Traversal */
#include<iostream>
#include<queue>
using namespace std;
struct Node {
char data;
Node *left;
Node *right;
};
/*
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 / 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;