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> | |
| char s[] = "rohit"; | |
| void reverse(int); | |
| int main() | |
| { | |
| printf("%s",s); | |
| reverse(0); | |
| printf("\n"); | |
| printf("%s",s); |
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
| void finddepth(Node *node,int depth){ | |
| if(node!=NULL){ | |
| depth=max(finddepth(node->left,depth+1), finddepth(node->right,depth+1) ); | |
| } | |
| return depth; | |
| } | |
| On Mon |
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> | |
| typedef struct node{ | |
| struct node* left; | |
| struct node* right; | |
| int value; | |
| }treenode; | |
| int add_node(treenode**tree, int value); |
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> | |
| char *s = "welcome to linux shell !"; | |
| char t[100]; | |
| //output = welcome to linux shell ! | |
| int main() | |
| { | |
| int i,j,flag=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 <string.h> | |
| void swap(char*a,char*b) | |
| { | |
| char t; | |
| t = *a; | |
| *a=*b; | |
| *b=t; | |
| } | |
| void permute(char* s, int i, int n) |
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> | |
| #include <string.h> | |
| #define HASH_TABLE_SIZE 100 | |
| #define HASH_TABLE_DELETE_ELEMENT_CHECK_FOR_ERRORS(t, n) | |
| if (hash_table_delete_element(t, n) == 0) | |
| hash_table_fatal_error(0, n) |
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> | |
| int main() | |
| { | |
| int input[] = {1, 3, 5 ,8 ,9 ,2 ,6, 7, 6, 8, 9}; | |
| int n = sizeof(input)/sizeof(int); | |
| int dp[n]; | |
| int i,j,min,value,x; | |
| dp[n-1] = 0; | |
| for(i=n-2;i>=0;i--) |
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> | |
| int main() | |
| { | |
| int arr[] = {1, 3, 5, 8, 9, 1,1,2, 6, 7, 6, 8}; | |
| int n = sizeof(arr)/sizeof(int); | |
| int i,j,step=0,jump=0,choice,max,val; | |
| for(i=0;i<n;) | |
| { | |
| choice = arr[i]; |
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> | |
| char in[]= {'d','b','e','a','f','c','g'}; | |
| char pre[]={'a','b','d','e','c','f','g'}; | |
| int size = sizeof(in); | |
| int pos = 0; | |
| typedef struct node{ | |
| char value; |
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> | |
| int t[8] = {-1}; | |
| int sol = 1; | |
| void printsol() | |
| { | |
| int i,j; | |
| char crossboard[8][8]; | |
| for(i=0;i<8;i++) |