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
void sort(char **w,int count) | |
{ | |
int i,j; | |
for(i=0;i<count;i++) | |
for(j=0;j<count-i-1;j++) | |
if(strcmp(w[j],w[j+1])>0) | |
{ | |
char *temp=w[j]; | |
w[j]=w[j+1]; | |
w[j+1]=temp; |
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 | |
{ | |
int val; | |
struct node* next; | |
}; | |
void enqueue(struct node**,struct node **,int); |
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
void stringgen(char *c) | |
{ | |
int i=0,j=0,l; | |
l=strlen(c); | |
while(l>=1) | |
{ | |
for(i=0;i<l;++i) | |
{ | |
char *buf=malloc(sizeof(char)*(i+2)); | |
for(j=0;j<=i;j++) |
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 | |
{ | |
int val; | |
struct node* next; | |
}; | |
void enqueue(struct node**,struct node **,int); |
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
void writestring(char *); | |
void writedigit(int); | |
void writestring(char *s) | |
{ | |
FILE *fp; | |
char nl[]="\n"; | |
fp=fopen("output","a"); | |
fprintf(fp,"%s",nl); | |
fprintf(fp,"%s",s); | |
fclose(fp); |
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
4 | |
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 |
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 bst | |
{ | |
struct bst *left,*right; | |
int val; | |
}; | |
struct bst* makenode(int); |
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
10 | |
5 | |
7 | |
3 | |
0 | |
9 | |
8 | |
2 | |
1 | |
6 |
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> | |
#include <string.h> | |
struct node | |
{ | |
char *val; | |
struct node *next; | |
}; | |
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
int binsearch(int *,int,int,int); | |
int binsearch(int *a,int low,int high,int key) | |
{ | |
while(high>=low) | |
{ | |
int mid=(low+high)/2; | |
if(a[mid]==key) | |
return 1; | |
else if(a[mid]>key) | |
high=mid-1; |
OlderNewer