Skip to content

Instantly share code, notes, and snippets.

import boto.route53, boto.sqs, boto.ec2
import uuid
volume_filter = {
'tag:active': 'True',
'volume-type': 'gp2',
'tag:role': 'indexer'
}
ec2 = boto.ec2.connect_to_region('eu-west-1')
@murikadan
murikadan / INFINITY ADDER
Last active December 16, 2015 10:09
Program to add numbers of any lenghth using linked lists
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define SIZE 10001
struct node
{
unsigned short int val;
node* next;
};
@murikadan
murikadan / bin_insertion.c
Created September 2, 2012 06:11
Inserting an element into a sorted array
int binpos(int *,int,int,int);
int insert(int *,int,int);
int binpos(int *a,int low,int high,int key)
{
int mid=0;
while(high>=low)
{
mid=(low+high)/2;
if(a[mid]==key)
@murikadan
murikadan / binsearch.c
Created August 31, 2012 13:11
Iterative Binary Search
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;
@murikadan
murikadan / hash.c
Created August 30, 2012 06:35
Linked List Sort
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct node
{
char *val;
struct node *next;
};
@murikadan
murikadan / input00
Created August 29, 2012 06:00
Quick Sort Of An Integer Array
10
5
7
3
0
9
8
2
1
6
@murikadan
murikadan / bst.c
Created August 28, 2012 10:46
Binary Search Tree
#include <stdio.h>
#include <stdlib.h>
struct bst
{
struct bst *left,*right;
int val;
};
struct bst* makenode(int);
@murikadan
murikadan / input
Created August 28, 2012 05:41
To reverse K nodes in a linked list
4
1
2
3
4
5
6
7
8
9
@murikadan
murikadan / file_write.c
Created August 27, 2012 13:35
Write a string or a number to a file
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);
@murikadan
murikadan / linked_list_reverse.c
Created August 26, 2012 12:43
Program to reverse a linked list using stack
#include <stdio.h>
#include <stdlib.h>
struct node
{
int val;
struct node* next;
};
void enqueue(struct node**,struct node **,int);