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 data; | |
struct Node *link; | |
}; | |
void printList(struct Node *head) { | |
struct Node *ptr = head; |
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
/* WAP in 'C' to find out the union of two set */ | |
#include <stdio.h> | |
int main() { | |
int i, j, k = 0; /* Counters */ | |
int a[] = {1, 3, 5, 7, 9, 11}; | |
int b[] = {2, 4, 6, 12, 14, 16, 18, 8, 10, 12, 14, 16, 18, 20}; | |
int r[99] = {}; |
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 countingSort(int arr[], int len, int k, int out[]) { | |
int i, j; | |
int temp[k]; | |
for(i = 0; i < k; i++) | |
temp[i] = 0; | |
for(j = 0; j < len; j++) |
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 partition(int s[], int l, int h) { | |
int i, p, firsthigh, temp; | |
p = h; | |
firsthigh = l; | |
for (i = l; i < h; i++) { | |
if (s[i] < s[p]) { | |
temp = s[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
/* Selection Sort Algorithm */ | |
#include <stdio.h> | |
int main() { | |
int i, j; | |
int min, temp; | |
int c = 0, s = 0; | |
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> | |
int main() | |
{ | |
int i, count = 0, low, high, mid, n, key, array[100]; | |
scanf("%d",&n); | |
for(i = 0; i < n; i++) | |
scanf("%d",&array[i]); | |
scanf("%d", &key); | |
low = 0; | |
high = n - 1; |
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 m, n, i, out; | |
scanf("%d", &m); | |
int arr[m]; | |
for(i = 0; i < m; i++) | |
scanf("%d", &arr[i]); | |
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> | |
int main() { | |
int x1, x2, v1, v2, i = 0, flag = 0; | |
scanf("%d%d%d%d", &x1, &v1, &x2, &v2); | |
for (i = 0; i < 10000; i++) { | |
if ((x1 + i*v1) == (x2 + i*v2)) { | |
flag = 1; | |
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> | |
int main() { | |
int num, i; | |
scanf("%d", &num); | |
int array[num]; | |
for (i = 0; i < num; i++) { | |
scanf("%d", &array[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
#user nobody; | |
worker_processes 1; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; |