This file contains hidden or 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
import java.io.*; | |
import java.util.*; | |
class palin_anagram | |
{ | |
void str(String s) | |
{ | |
char ch[]=s.toCharArray(); | |
Arrays.sort(ch); | |
int l=s.length(); | |
if(l%2==0) |
This file contains hidden or 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<conio.h> | |
#include<string.h> | |
#include<stdlib.h> | |
# define MAX 20 | |
char str[MAX],stack[MAX]; | |
int top=-1; | |
void push(char c) | |
{ | |
stack[++top]=c; |
This file contains hidden or 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<conio.h> | |
#include<string.h> | |
#include<stdlib.h> | |
# define MAX 20 | |
char str[MAX],stack[MAX]; | |
int top=-1; | |
void push(char c) | |
{ | |
stack[++top]=c; |
This file contains hidden or 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<conio.h> | |
#include<string.h> | |
#include<stdlib.h> | |
# define MAX 20 | |
char str[MAX],stack[MAX]; | |
int top=-1; | |
void push(char c) | |
{ | |
stack[++top]=c; |
This file contains hidden or 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> | |
struct spa | |
{ | |
int row; int col; int val; | |
}; | |
main() | |
{ | |
struct spa a[20],b[20]; | |
printf("Enter of rows, coloums, and number of elements\n"); | |
scanf("%d%d%d",&a[0].row,&a[0].col,&a[0].val); |
This file contains hidden or 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<string.h> | |
//to enter number of strings and then sort the string lexicographically | |
main() | |
{ | |
char str[10][20],*p=&str[0][0]; | |
printf("Enter n\n"); int i,n; | |
scanf("%d",&n); | |
for(i=0; i<n; i++) | |
scanf("%s",(p+i*20)+0); |
This file contains hidden or 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> | |
main() | |
{ int a[20],front=-1,x,n; | |
printf("enter size of stack\n"); | |
scanf("%d",&n); n=n-1; | |
while(1) | |
{ printf("Enter 1 to push,2 to pop and 3 to display:\n"); | |
int c; scanf("%d",&c); | |
switch(c) | |
{ case 1:{front=push(&a,front,n); break;} |
This file contains hidden or 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> | |
main() | |
{ int a[20],front=-1,rear=-1,x,n; | |
printf("enter size of queue\n"); | |
scanf("%d",&n); n=n-1; | |
while(1) | |
{ printf("Enter 1 to push,2 to pop and 3 to display:\n"); | |
int c; scanf("%d",&c); | |
switch(c) | |
{ case 1:{rear=push(&a,rear,n); break;} |
This file contains hidden or 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 | |
{ | |
int val; | |
struct node *link; | |
}; | |
struct node* getnode( ) | |
{ |
This file contains hidden or 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> | |
#define max 100 | |
int top=-1, a[max]; | |
void push(char x) | |
{ | |
a[++top]=x; | |
} | |
char pop() | |
{ if(top==-1) | |
return -1; |
OlderNewer