Posts

Showing posts from August, 2018

C program to implement stack | Push Pop Operation on Stack Using Functions

Copy the Code  /*     c program to implement stack with struct and functions.  *  *     BY :- KHUSHIT SHAH, khushitshah1@gmail.com  *  */ #include<stdio.h> #include<conio.h> // not necessary. #include<process.h> #define MAX 10 struct Stack{     int top;     int data[MAX]; }stack; void push(){     if(stack.top == MAX-1){         printf("Stack Overflow \n");         return;     }     else{         int item;         printf("Enter the value of data item : ");         scanf("%d",&item);         stack.data[++stack.top] = item;         printf("%d is added at place %d \n",stack.data[stack.top],stack.top);  ...

Code to Implement Dynamic Queue in C++ using arrays

Implementing Queues in c++ with arrays:  introduction:            Queues are  linear data structures . They are used almost everywhere in software development , AI , machinelearning etc.. Topics Used: Templates in c++ . classes in c++ . switch case. loops. code: Buyahh copy and paste the code ==>. #include <iostream> using namespace std; #define SIZE 10 template < class Eltype >         class Queue {                 /*                  *  MAXSIZE carries the max no of element a queue can have.                  *  nItem  carries the no of element queue have.                  *   front carries current front index                  *  ...