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> | |
#define FIN "complex.in" | |
#define FOUT "complex.out" | |
struct TComplex { | |
int real, | |
imag; | |
}; | |
typedef struct TComplex Complex; |
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
/** | |
* | |
* Eratosthenes of Cyrene. | |
* | |
*/ | |
#include <iostream> | |
#include <cstdlib> | |
using namespace std; |
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
/** | |
* | |
* Eratosthenes of Cyrene. | |
* | |
*/ | |
#include <iostream> | |
#include <cstdlib> | |
using namespace std; |
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
/* | |
* Author: Adrian Statescu <mergesortv@gmail.com> | |
* Description: Byte Swapping. | |
*/ | |
#include <stdio.h> | |
void __byteswapping__(void *x1, void *x2, size_t size) { | |
char *x = (char*)x1; |
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
def comb_sort( list ) | |
shrinkFactor = 1.3 | |
swapped = true | |
n, gap = list.size, list.size | |
until (gap == 1) && !swapped |
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 <malloc.h> | |
#define FIN "coliban.in" | |
int euclid(int a, int b) { | |
if(b == 0) return a; | |
else return euclid(b, a % b); | |
} |
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 <malloc.h> | |
struct Node { | |
int info; | |
struct Node *next; | |
}; | |
typedef struct Node Node; |
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
/* | |
* Test if a number is Prime or not. | |
*/ | |
#include <stdio.h> | |
int isPrime(int n) { | |
if(n == 0 || n == 1) return 0; | |
if(n == 2 || n == 3) return 1; |
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> | |
#define Q_MAX 10 | |
struct Queue { | |
int queue[Q_MAX]; | |
int rear, | |
front; | |
}; |
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
/** | |
* Queue Data Structure implemented as Array | |
*/ | |
#include <stdio.h> | |
#define QUEUE_MAX 5 | |
//declare my queue and two pointers to this data structure | |
int queue[ QUEUE_MAX ], | |
front = -1, | |
rear = -1; |