Skip to content

Instantly share code, notes, and snippets.

View priyadarshitathagat's full-sized avatar
🎯
Focused

Tathagat Priyadarshi priyadarshitathagat

🎯
Focused
View GitHub Profile
@priyadarshitathagat
priyadarshitathagat / Stack.c
Created October 6, 2016 15:34
Stack using Double linked list
#include <stdio.h>
#include<stdlib.h>
struct node
{
int val;
struct node *left;
struct node *right;
};
struct node* getnode( )
@priyadarshitathagat
priyadarshitathagat / sort_linked_list.c
Last active October 6, 2016 19:12
Sorting of linked list
//sorting the elements of a linked list by selection sort technique
#include <stdio.h>
#include<stdlib.h>
struct node
{
int val;
struct node *link;
};
struct node* getnode( )
@priyadarshitathagat
priyadarshitathagat / polynomials.c
Created October 6, 2016 15:33
Addition of polynomials using linked list
//addition of polynomials
#include <stdio.h>
#include<stdlib.h>
struct node
{
int coeff;
int exp;
struct node *link;
};
@priyadarshitathagat
priyadarshitathagat / circular_queue.c
Created October 3, 2016 19:00
Implementation of circular queue
#include<stdio.h>
#include<stdlib.h>
#define max 25
int front=0,rear=-1,c=0; //c to count the number of inputs in the queue
struct stack{
int a;
};
@priyadarshitathagat
priyadarshitathagat / prefix_evaluation.c
Created October 3, 2016 18:11
Evaluation of a given prefix expression containing single digits number as operands
#include<stdio.h>
#include<string.h>
int top=-1; char a[20];
void push(char x)
{
a[++top]=x;
}
char pop()
{
return(a[top--]);
@priyadarshitathagat
priyadarshitathagat / postfix_evaluation.c
Created October 3, 2016 18:11
Evaluation of a given postfix expression containing single digits number as operands
#include<stdio.h>
#include<string.h>
int top=-1; char a[20];
void push(char x)
{
a[++top]=x;
}
char pop()
{
return(a[top--]);
@priyadarshitathagat
priyadarshitathagat / String_Combination.c
Created September 30, 2016 15:48
Combination of Strings
#include <iostream>
#include <cstring>
#include<cstdio>
using namespace std;
void swap(char*,char*);
void combo(char *, int, int);
void combo(char*);
int main()
{
char ch[100];
@priyadarshitathagat
priyadarshitathagat / infix_to_prefix.c
Created September 23, 2016 21:00
Program to covert infix expression to prefix expression in c
#include<stdio.h>
#define max 100
int top=-1, a[max];
void push(char x)
{
a[++top]=x;
}
char pop()
{ if(top==-1)
return -1;
@priyadarshitathagat
priyadarshitathagat / linked_dequeue.c
Last active October 1, 2016 13:17
Program to implement DEQUEUE (to insert elements from rear/front and also delete elements from rear/front) concept using linked list
#include <stdio.h>
#include<stdlib.h>
struct node
{
int val;
struct node *link;
};
struct node* getnode( )
{
@priyadarshitathagat
priyadarshitathagat / linked_queue.c
Created September 23, 2016 20:04
Program to implement QUEUE (insert element at rear and remove elements form front) concept using linked list
#include <stdio.h>
#include<stdlib.h>
struct node
{
int val;
struct node *link;
};
struct node* getnode( )
{