If Any Required Program Please Ask In Comment I Will Help You(any Program in JAVA or C++) . . THANKS FOR VISITING MY BLOG!

If U LIKE MY PROFILE RAISE YOUR HAND IF U NOT RAISE UR STANDARD. Powered by Blogger.

If Any Required Program Please Ask In Comment I Will Help You(any Program in JAVA or C++) . . THANKS FOR VISITING MY BLOG!

Friday, October 26, 2018

PROGRAM TO FIND NUMBER AND IT'S OCCURRENCES USING LINK LIST.


#include <iostream> #include <stdlib.h> #include <conio.h> using namespace std; class Chain; template <class Type> class Node { private: Type Info; Node<int> *Link; friend class Chain; }; class Chain { private: Node<int> *First; public: Chain() { First = NULL; } void Head_Insert(int Value) { Node<int> *Temp = new Node<int>; Temp->Info...

PROGRAM FOR SEARCHING IN LINK LIST.


#include <iostream> #include <stdlib.h> #include <conio.h> using namespace std; class Chain; template <class Type> class Node { private: Type Info; Node<int> *Link; friend class Chain; }; class Chain { private: Node<int> *First; public: Chain() { First = NULL; } void Head_Insert(int No) { Node<int> *Temp = new Node<int>; Temp->Info...

LINKED LISTS TO PRINT ELEMENTS IN REVERSE ORDER USING RECURSION.


#include <iostream> #include <stdlib.h> #include <conio.h> using namespace std; class Chain; template <class Type> class Node { private: Type Info; Node<int> *Link; friend class Chain; }; class Chain { private: Node<int> *First; public: Chain() { First = NULL; } void Head_Insert(int Value) { Node<int> *Temp = new Node<int>; Temp->Info...

PROGRAM FOR THE LINKED LISTS TO COUNT EVEN NODES.


#include <iostream> #include <stdlib.h> #include <conio.h> using namespace std; class Chain; template <class Type> class Node { private: Type Info; Node<int> *Link; friend class Chain; }; class Chain { private: Node<int> *First; public: Chain() { First = NULL; } void Head_Insert(int Value) { Node<int> *Temp = new Node<int>; Temp->Info...

PROGRAM FOR THE LINKED LISTS TO COUNT NODES.


#include <iostream> #include <stdlib.h> #include <conio.h> using namespace std; class Chain; template <class Type> class Node { private: Type Info; Node<int> *Link; friend class Chain; }; class Chain { private: Node<int> *First; public: Chain() { First = NULL; } void Head_Insert(int Value) { Node<int> *Temp = new Node<int>; Temp->Info...

PROGRAM FOR THE LINKED LISTS.


#include <iostream> #include <stdlib.h> #include <conio.h> using namespace std; class Chain; template <class Type> class Node { private: Type Info; Node<int> *Link; friend class Chain; }; class Chain { private: Node<int> *First; public: Chain() { First = NULL; } void Head_Insert(int Value) { Node<int> *Temp = new Node<int>; Temp->Info...

Sunday, October 21, 2018

CHECK WHETHER STRING IS PALINDROME USING STACK.


#include <iostream> #include <stdlib.h> #include <conio.h> #include <string.h> using namespace std; template <class Type> class Palindrom { private: int Top, Size; Type *Arr; public: Palindrom(int Siz) { Top = -1; Size = Siz; Arr  = new Type[Size]; strcpy(Arr, "\0"); } void Push(Type Ch) { if(Top == Size-1) { cout << "\nStack...

CHECK BRACKETS OF EXPRESSION ARE BALANCED or NOT using STACK.


#include <iostream> #include <string.h> #include <stdlib.h> #include <conio.h> using namespace std; template <class Type> class Brackets { private: Type *Stack, *String; bool Valid; int Size, Top; public: Brackets(int Siz) { Size = Siz; Stack = new Type[Size]; strcpy(Stack, "\0"); Valid = true; Top = -1; } void Push(Type Ch) { if (Top == Size...

PROGRAM TO STORE char IN STACK USING TEMPLATES.


#include <iostream> #include <stdlib.h> #include <conio.h> using namespace std; template <class Type> class Stack { private: Type *Arr; int Top, Size; public: Stack(int Siz) { Size = Siz; Arr = new Type[Size]; for (int I = 0; I <Size; I++) { Arr[I] = 0; } Top = -1; } void Push(Type Num) { if (Top == Size - 1) { cout << "\nStack...

PROGRAM TO SIMPLIFY PREFIX EXPRESSION.


#include <iostream> #include <conio.h> #include <string.h> #include <math.h> #include <cctype> #include <stdlib.h> using namespace std; template <class Type> class Simplify { private: Type *Stack; int Top, Size; public: Simplify(int Siz) { Size = Siz; Stack = new Type[Size]; for(int I =0; I <Size; I++) {     Stack[I] = 0; ...

PROGRAM TO SIMPLIFY POSTFIX EXPRESSION.


#include <iostream> #include <conio.h> #include <string.h> #include <math.h> #include <cctype> #include <stdlib.h> using namespace std; template <class Type> class Simplify { private: Type *Stack; int Top, Size; public: Simplify(int Siz) { Size = Siz; Stack = new Type[Size]; for(int I =0; I <Size; I++) {     Stack[I] = 0; ...

PROGRAM TO SIMPLIFY INFIX EXPRESSION.


#include <iostream> #include <conio.h> #include <string.h> #include <math.h> #include <cctype> #include <stdlib.h> using namespace std; template <class Type> class Simplify { private: Type *Stack; int Top, Size; public: Simplify(int Siz) { Size = Siz; Stack = new Type[Size]; for(int I =0; I <Size; I++) {     Stack[I] = 0; ...

PROGRAM FOR Tower Of Hanoi.


#include <iostream> #include <stdlib.h> #include <conio.h> using namespace std; int TOH(int, char, char, char ); int main() { int No; cout << "Enter Number Of Disks: "; cin >> No; TOH(No, 'A', 'B', 'C');     getch(); return 0; } int TOH(int N, char Src, char Aux, char Dest) { if (N == 1)     {         cout <<...

PROGRAM FOR TABLE OF NUMBER using RECURSION.


#include <iostream> #include <conio.h> using namespace std; int Table(int A, int B); int main() {     int I = 1 ,No;     cout << "Enter Any Number: ";     cin >> No;     cout << "\nThis is a Function returning Value: " << Table(No, 10) <<endl;     getch();     return 0; } int Table(int A,...

PRINT ARRAY ELEMENTS IN REVERSE ORDER using RECURSION.


#include <iostream>> #include <conio.h> using namespace std; int Reverse(int *Arr, int No); int main() {     int Size = 10;     int *Arr = new int[Size];     cout << "Enter Elements Of Array is:  " << endl;     for(int I =1; I <=Size; I++)     {         Arr[I] = I;      ...

PROGRAM FOR POWER using RECURSION.


#include <iostream> #include <conio.h> using namespace std; long Power(int A, int B); int main() { int No, Pow; cout << "Enter Any Number: "; cin >> No; cout << "Power of Number is: "; cin >> Pow; cout << "\nResult is: " << Power(No, Pow) << endl; getch(); return 0; } long Power(int A, int B) { long Result; if (B == 1) return...

PROGRAM FOR FACTORIAL using RECURSION.


#include <iostream> #include <conio.h> using namespace std; long Fact(int Num); int main() { int No; cout << "Enter Any Number: "; cin >> No; cout << "\nFactorial Of Given Number is: " << Fact(No) << endl; getch(); return 0; } long Fact(int Num) { long Result; if (Num == 1) return 1; Result = Num * Fact(Num - 1); return Result;...

PROGRAM FOR FABIONCCI SERIES using RECURSION.


#include <iostream> #include <conio.h> using namespace std; int Fabionnci(int A); int main() {     int I = 1 ,No;     cout << "Enter Any Number: ";     cin >> No;     while(I <= No)     {       cout << Fabionnci(I) << endl;       I++;     }     getch();  ...

PROGRAM FOR BINARY SEARCH USING RECURSION.


#include <iostream> #include <conio.h> using namespace std; int B_Search(int *Arr, int No, int Beg, int End ); int main() {     int  *Array, Value, Size = 10;     Array = new int[Size];     for(int I = 0; I <Size; I++)         Array[I] = I +1;     cout << "Enter Value You Want To Search: ";    ...

PROGRAM TO GET SUM OF ARRAY ELEMENTS using RECURSION.


#include <iostream>> #include <conio.h> using namespace std; long Sum(int *Arr, int No); int main() {     int Size = 10;     int *Arr = new int[Size];     cout << "Enter Elements Of Array is:  " << endl;     for(int I =1; I <=Size; I++)     {         Arr[I] = I;        ...

PROGRAM FOR SIMPLEST QUEUE.


#include <iostream> #include <stdlib.h> #include <conio.h> using namespace std; template <class Type> class Queue { private: Type *Arr; int Front, Rear, Size; public: Queue(int Siz) { Siz = Size; Arr = new Type[Size]; Front = Rear = -1; } void EnQueue(Type Ch) { if (IsFull()) { cout << "\nQueue OverFlowed!!!\n" << endl; exit(1); ...

PROGRAM FOR QUEUE BY MOVING ELEMENTS ONE DOWN.


#include <iostream> #include <stdlib.h> #include <conio.h> using namespace std; template <class Type> class Queue { private: Type *Arr; int Size, Front; public: Queue(int Siz) { Size = Siz; Arr = new Type[Siz]; Front = -1; } void EnQueue(Type Ch) { if (IsFull()) { cout << "\nQueue Overflowed!!!\n" << endl; exit(1); } Arr[++Front]...

PROGRAM FOR DeQUEUE.


#include <iostream> #include <stdlib.h> #include <conio.h> using namespace std; template <class Type> class DeQueue { private: Type *Queue; int Size, Front, Rear, Count; public: DeQueue(int Siz) { Size = Siz; Queue = new Type[Size]; Front = Count = -1; Rear = Size - 1; } void EnQueue_Beg(Type Ch) { if (IsFull()) { cout << "\nSTACK OVERFLOWED...!!!\n"...

PROGRAM FOR CIRCULAR QUEUE.


#include <iostream> #include <stdlib.h> #include <conio.h> using namespace std; template <class Type> class Queue { private: Type *Arr; int Front, Rear, Size; public: Queue(int Siz) { Size = Siz; Arr = new Type[Size]; Front = Rear = Size - 1; } void EnQueue(Type Ch) { int Temp = (Rear + 1) % Size; if (Temp == Front) { cout << "\nQueue OverFlowed..!!!\n"...

PRIORITY QUEUE IN DESCENDING ORDER USING SORTING TECHNIQUES.


#include <iostream> #include <stdlib.h> #include <conio.h> using namespace std; template <class Type> class PQueue { private: Type *Queue; int Size, Rear; public: PQueue(int Siz) { Size = Siz; Queue = new Type[Size]; Rear = -1; } void EnQueue(Type Ch) { if (IsFull()) { cout << "\nQueue OverFlowed...!!!\n" << endl; exit(1); } ...

PRIORITY QUEUE IN ASCENDING ORDER USING SORTING TECHNIQUES.


#include <iostream> #include <stdlib.h> #include <conio.h> using namespace std; template <class Type> class PQueue { private: Type *Queue; int Size, Rear; public: PQueue(int Siz) { Size = Siz; Queue = new Type[Size]; Rear = -1; } void EnQueue(Type Ch) { if (IsFull()) { cout << "\nQueue OverFlowed...!!!\n" << endl; exit(1); } ...

PROGRAM FOR PRIORITY QUEUE FOR DESCENDING ORDER.


#include <iostream> #include <stdlib.h> #include <conio.h> using namespace std; template <class Type> class PQueue { private: Type *Queue; int Size, Rear; public: PQueue(int Siz) { Size = Siz; Queue = new Type[Siz]; Rear = -1; } void EnQueue(Type Ch) { if (Rear == Size - 1) { cout << "\nQueue OverFlowed!!!\n" << endl; exit(1); } ...

PROGRAM FOR PRIORITY QUEUE FOR ASCENDING ORDER.


#include <iostream> #include <stdlib.h> #include <conio.h> using namespace std; template <class Type> class PQueue { private: Type *Queue; int Size, Rear; public: PQueue(int Siz) { Size = Siz; Queue = new Type[Siz]; Rear = -1; } void EnQueue(Type Ch) { if (Rear == Size - 1) { cout << "\nQueue OverFlowed!!!\n" << endl; exit(1); } ...

CONVERTING INFIX EXPRESSION INTO PREFIX EXPRESSION.


#include <bits/stdc++.h> #include <iostream> #include <string.h> #include <cctype> #include <stdlib.h> #include <conio.h> using namespace std; template <class Type> class Infix2Prefix { private:     Type *Stack;     int Size, Top; public:     Infix2Prefix(int Siz)     {         Size = Siz;  ...