Skip to content

Instantly share code, notes, and snippets.

View this-mkhy's full-sized avatar
:octocat:
PlayFifa PlayCode

Mohamed Khaled Yousef this-mkhy

:octocat:
PlayFifa PlayCode
View GitHub Profile
@this-mkhy
this-mkhy / linkedlistOperations.cpp
Created December 6, 2017 03:46
The implementation of all linked list operations in C++
#include<iostream>
using namespace std;
//built node .... node = (data and pointer)
struct node //node or link
{
int data; //data item
node* next; //pointer to next node
@this-mkhy
this-mkhy / Stack.cpp
Created December 6, 2017 03:51
Stack implementation by class, Safe stack.
//Stack implementation by class,safe stack.
#include <iostream>
using namespace std;
class stack
{
private:
//Declare array in class
enum{MAX=10};
int st[MAX];
@this-mkhy
this-mkhy / StackSTL.cpp
Last active May 18, 2018 12:05
Stack in STL
#include <iostream>
#include <stack>
using namespace std;
void printStack(stack <int> myStack)
{
stack <int> s= myStack;
while (!s.empty())
@this-mkhy
this-mkhy / StackAndLinkedList.cpp
Created December 6, 2017 03:55
Stack using linked list
//Stack using linked list
#include<iostream>
using namespace std;
//Define node pointer
struct node
{
int data;
node* next;
@this-mkhy
this-mkhy / BalancedBrackets.cpp
Created December 6, 2017 03:58
Use stack to solve Balanced Brackets problem (Medium level)
#include <bits/stdc++.h>
using namespace std;
bool isBalanced(string s)
{
vector<char> openingBracketsStack;
for(int i=0; i<s.size() ;++i)
{
@this-mkhy
this-mkhy / Queue.cpp
Created December 6, 2017 04:01
Create Queue DS
#include <bits/stdc++.h>
using namespace std;
struct node
{
int data;
node *next;
}
*front = NULL,*tail = NULL,*Node = NULL,*newNode = NULL;
@this-mkhy
this-mkhy / Queue.cpp
Created December 6, 2017 04:04
Create Queue using Linked list
//QUEUE USING LINKED LIST
#include <bits/stdc++.h>
#include<conio.h>
using namespace std;
//Create a NODE
struct node
{
@this-mkhy
this-mkhy / Queue2Stack.cpp
Created December 6, 2017 04:06
Create Queue using 2 stack.
//Using 2 stacks
#include<iostream>
#include<stack>
using namespace std;
class myQueue
{
private:
@this-mkhy
this-mkhy / QueueArray.cpp
Created December 6, 2017 04:08
Create Queue using Array.
//Using Array
#include <iostream>
using namespace std;
// Constants
#define max 20
// Functions

Keybase proof

I hereby claim:

  • I am mohamedkhaledyousef on github.
  • I am mkhy (https://keybase.io/mkhy) on keybase.
  • I have a public key whose fingerprint is D187 19A0 E303 6068 B8C4 A368 7C9F 5AC8 B423 F0EE

To claim this, I am signing this object: