This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#define maxsize 10 | |
using namespace std; | |
class Stack | |
{ | |
int top; | |
int a[maxsize]; | |
public: | |
Stack(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#define MAX_SIZE 6 | |
#define MINUS_INF -999999 | |
using namespace std; | |
class Queue | |
{ | |
int arr[MAX_SIZE]; | |
int frnt; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<stdio.h> | |
#include<stdlib.h> | |
#define FAILURE -9999999 | |
#define SUCCESS 9999999 | |
using namespace std; | |
int cnt=0; | |
typedef struct Node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<cstdio> | |
#include<cstdlib> | |
using namespace std; | |
struct node | |
{ | |
int value; | |
struct node* next; | |
struct node* prev; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstdlib> | |
using namespace std; | |
#define MAX 20 | |
class AdjacencyMatrix | |
{ | |
private: | |
int n; | |
int **adj; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
} |
OlderNewer