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 <math.h> | |
struct point | |
{ | |
double x, y, z; | |
}; | |
int main() | |
{ |
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
/***********************TEST CASES***************************/ | |
char ac_path[100]="LULLLUSULLUSLL"; | |
int ac_path_len=14; | |
/***********************************************************/ | |
char opt_path[100]; // save the moves of optimised path | |
int opt_path_len; // optimised path lenght | |
/* Did You Know? opt_path_len<=ac_path_len */ | |
// function that checks whether the path is optimisable... meanwhile optimises it |
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 <malloc.h> | |
void print(int arr[], int size) | |
{ | |
int i; | |
for (i=0; i < size; i++) | |
printf("%d, ", arr[i]); | |
printf("\b\b \b\b\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> | |
#include <limits.h> | |
#include <math.h> | |
struct node{ | |
float data; | |
struct node *next; | |
}; |
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> | |
void swap(int *xp, int *yp) | |
{ | |
int temp = *xp; | |
*xp = *yp; | |
*yp = temp; | |
} | |
void selectionSort(int arr[], 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 <string.h> | |
int main() | |
{ | |
int i, j, n; | |
char str[100][50], temp[50]; | |
printf("Enter the no. of words"); | |
scanf("%d", &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> | |
#include <limits.h> | |
#include <math.h> | |
struct node{ | |
float data; | |
struct node *next; | |
}; |
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> | |
int main(int argc, char const *argv[]) | |
{ | |
char sentence[100][100], search_word[100]; | |
int no_of_words = 0, freq = 0; | |
printf("Enter the no of words: "); // user prompt for: | |
scanf("%d", &no_of_words); // total no. of words in the sentence |
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
int binary_search_DLL() | |
{ | |
sorting(); // 'cause binary search is possible in sorted list only | |
int search_key; | |
printf("\n\nEnter the element : "); // user promt for | |
scanf("%d",&search_key); // searching element | |
struct node *ptr, *lptr, *rptr, *midptr; | |
lptr = header; // left end of the working list, initially header |
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 <malloc.h> | |
typedef struct Node{ | |
int data; | |
struct Node* next; | |
}node; // nickname :) | |
node* createCircularList() | |
{ |
OlderNewer