Skip to content

Instantly share code, notes, and snippets.

View M2skills's full-sized avatar

Mohit Makhija M2skills

View GitHub Profile
@M2skills
M2skills / middleLL.py
Last active March 28, 2017 20:00
Code to find the middle node in the linked list in single traversal in python.
# program to find the middle node of the Linked List in single traversal
class LinkedList:
def __init__(self):
self.head = None
# returns true is LinkedList is Empty
def isEmpty(self):
if self.head is None:
return True
@M2skills
M2skills / stack.py
Created November 12, 2016 11:39
Simple Stack implementation in Python
__author__ = 'MOHIT'
# program to implement stack in python using python lists
# create a simple empty list
stax = []
# top variable
top = -1
@M2skills
M2skills / stack.c
Created November 12, 2016 11:35
Simple Stack implementation in C
/* program for stack implementation in c*/
#include <stdio.h>
#include <stdlib.h>
#include<conio.h>
//global variables
int stackk[20],top;
//function definition
void push(int);
/*program to draw a graph of rainfall acording to % for 5 years*/
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<math.h>
void drawline(int,int,int,int,int);
void main()
{
int gd=0,gm,i;