Skip to content

Instantly share code, notes, and snippets.

View echo-akash's full-sized avatar
🎯
If you don't fight for what you want, Don't cry for what you lost.

akash poddar echo-akash

🎯
If you don't fight for what you want, Don't cry for what you lost.
View GitHub Profile
@echo-akash
echo-akash / stack.cpp
Created March 1, 2017 02:48
Stack_Array Implementation in C++
#include<iostream>
#define maxsize 10
using namespace std;
class Stack
{
int top;
int a[maxsize];
public:
Stack();
@echo-akash
echo-akash / Queue.cpp
Last active March 2, 2017 15:32
Queue Implementation
#include<iostream>
#define MAX_SIZE 100
#define MINUS_INF -999999 //this value is not possible in this case so its returned when queue is empty
using namespace std;
class Queue{
int arr[MAX_SIZE];
int frnt;
int rear;
@echo-akash
echo-akash / LinkedList.c
Last active May 29, 2024 16:05
Implementation of Singly Linked List in C
#include<stdio.h>
#include<stdlib.h>
struct node //make node for linked list using structure
{
int value; //value part of node contains the element
struct node *next; //the next part of node contains the address of next element of list
};
struct node *head; //contains the address of first element of linked list
@echo-akash
echo-akash / StackByQueue.cpp
Created April 25, 2017 17:33
Implement Stack using Queue in C++
#include<iostream>
#define MAX_SIZE 6
#define MINUS_INF -999999
using namespace std;
class Queue
{
int arr[MAX_SIZE];
int frnt;
@echo-akash
echo-akash / StackByLinkedList.cpp
Created April 25, 2017 17:39
Implement Stack using Singly Linked List in C++
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#define FAILURE -9999999
#define SUCCESS 9999999
using namespace std;
int cnt=0;
typedef struct Node
@echo-akash
echo-akash / DoublyLinkedList.cpp
Created May 3, 2017 17:04
Implement Doubly Linked List using C++
#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;
struct node
{
int value;
struct node* next;
struct node* prev;
@echo-akash
echo-akash / BFS.cpp
Last active April 29, 2019 16:22
Implement Breadth First Search in Graph using Adjacency List in c++
#include<iostream>
#include<vector>
#include<queue>
using namespace std;
int n,m;
int dist[100];
int parent[100];
vector<int> adjList[100];
queue<int> q;
@echo-akash
echo-akash / BFS.cpp
Created May 3, 2017 17:11
Implement Breadth First Search in Graph using Adjacency Matrix in c++
#include <iostream>
#include <cstdlib>
using namespace std;
#define MAX 20
class AdjacencyMatrix
{
private:
int n;
int **adj;
@echo-akash
echo-akash / sum_3.c
Created June 30, 2017 15:20
Sum of 3 integers using c programming language
#include<stdio.h>
int main()
{
int x,y,z;
printf("enter the first integer:\n");
scanf("%d",&x);
printf("enter the second integer:\n");
scanf("%d",&y);
printf("enter the third integer:\n");
@echo-akash
echo-akash / print_ASCII.c
Created June 30, 2017 15:23
Take a character input and print its corresponding ASCII value in C Programming Language
#include<stdio.h>
int main()
{
char ch;
printf("enter any character\n");
scanf("%c",&ch);
printf("\nASCII value of entered character is:%d",ch);
return 0;
}