Skip to content

Instantly share code, notes, and snippets.

@VishnuSanal
VishnuSanal / Breadth First Search & Depth First Search in a Graph using C.md
Created March 12, 2022 11:32
Implementation of Breadth First Search & Depth First Search on a Graph data structure using C

BFS&DFS.c

#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>

#define MAX 10

struct Vertex {
@VishnuSanal
VishnuSanal / Linear Search & Binary Search in an Array using C.md
Created March 12, 2022 11:24
Implementation of Linear Search & Binary Search in an Array using C

Search.C

  • Linear Search
  • Binary search
#include <stdio.h>

int linearSearch(int[], int, int);
int binarySearch(int[], int, int);
@VishnuSanal
VishnuSanal / Bubble sort, Insertion sort, Selection sort, Quick sort, Merge sort & Heap sort in an Array using C.md
Last active May 9, 2022 16:28
Implementation of Bubble sort, Insertion sort, Selection sort, Quick sort, Merge sort & Heap sort in an Array using C

SortingTechniques.C

  • Bubble sort
  • Insertion sort
  • Selection sort
  • Quick sort
  • Merge sort
  • Heap sort
#include <stdio.h>
@VishnuSanal
VishnuSanal / Binary Search Tree in C.md
Last active March 19, 2022 18:24
Implementation of Binary Search Tree in C

BinarySearchTree.C

#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>

struct Node {
  int data;
  struct Node *left;
  struct Node *right;
@VishnuSanal
VishnuSanal / Polynomial Addition in C using Linked List.md
Created March 12, 2022 10:18
Implementation of Polynomial Addition using Linked List data structure in C

PolynomialAddition.C

#include <stdio.h>
#include <stdlib.h>

struct Node {
  int coefficient;
  int exponent;
  struct Node *link;
};
@VishnuSanal
VishnuSanal / Linked List in C.md
Last active April 23, 2022 15:38
Implementation of Linked List data structure in C

LinkedList.C

#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>

struct Node {
  int data;
  struct Node *link;
};
@VishnuSanal
VishnuSanal / Infix to Postfix in C.md
Last active March 12, 2022 11:37
Infix to Postfix conversion in C

InfixPostfix.C

#include <ctype.h>
#include <stdio.h>

char STACK[100];
int TOP = -1;

void convertPostFix(char[]);
int priority(char);
@VishnuSanal
VishnuSanal / Double Ended Queue using Array in C.md
Created March 12, 2022 09:14
Implementation of Double Ended Queue data structure using Array in C

DoubleEndedQueue.C

#include <stdbool.h>
#include <stdio.h>

#define MAX 5

int QUEUE[MAX], REAR = -1, FRONT = -1;

void insertRear();
@VishnuSanal
VishnuSanal / Circular Queue using Array in C.md
Last active May 9, 2022 16:20
Implementation of Circular Queue data structure using Array in C

CircularQueue.C

#include <stdbool.h>
#include <stdio.h>

#define MAX 5

int QUEUE[MAX], FRONT = -1, REAR = -1;
@VishnuSanal
VishnuSanal / Queue using Array in C.md
Last active May 9, 2022 16:19
Implementation of Queue data structure using Array in C

Queue.C

#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>

#define MAX 5

void enqueue();