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
struct node{ | |
node_t *lchild; | |
node_t *rchild; | |
node_t *parent; | |
int left; | |
int right; | |
int height; | |
int visited; |
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 "set.h" | |
#include <stdio.h> | |
#include <stdlib.h> | |
static int compare_ints(void *a, void *b) | |
{ | |
int *ia = a; | |
int *ib = b; | |
return (*ia)-(*ib); | |
} |
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 <stdlib.h> | |
#include "set.h" | |
#include <assert.h> | |
#include <sys/time.h> | |
typedef struct set_iter set_iter_t; | |
typedef struct set set_t; | |
typedef struct node node_t; | |
typedef struct stck stck_t; |
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
set_t *set_intersection(set_t *a, set_t *b){ | |
set_t *nyttsett=set_create(a->cmpfunc); | |
set_iter_t * iterA, *iterB; | |
iterA=set_createiter(a); | |
iterB=set_createiter(b); | |
void *aa; | |
void *bb; | |
aa=set_next(iterA); |
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
#!/usr/bin/env python | |
""" Pre-code for INF-1400 | |
16 January 2017 Revision 3 (Mads Johansen): | |
Rewritten to conform to Python 3 standard. Made class iterable, added property as_point, | |
replaced magnitude with __abs__ (to reflect mathematical vector notation), added rotate method. | |
22 January 2012 Revision 2 (Martin Ernstsen): | |
Reraise exception after showing error message. | |
11 February 2011 Revision 1 (Martin Ernstsen): | |
Fixed bug in intersect_circle. Updated docstrings to Python standard. |
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
SCREENX = 800 | |
SCREENY = 600 | |
SPACESHIPSIZE = 10 | |
LIMIT = 3 | |
GRAVITY = 0.2 |
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
SCREENX = 800 | |
SCREENY = 600 | |
SPACESHIPSIZE = 10 | |
LIMIT = 3 | |
GRAVITY = 0.2 |
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 "set.h" | |
#include "list.h" | |
#include <assert.h> | |
#include <stdlib.h> | |
#define DEBUG_CHECKSET 0 | |
struct treenode; | |
typedef struct treenode treenode_t; |
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 "index.h" | |
#include "common.h" | |
#include "map.h" | |
#include "set.h" | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
typedef struct index index_t; | |
struct index { | |
map_t *map; |
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 "index.h" | |
#include "common.h" | |
#include "map.h" | |
#include "set.h" | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <math.h> | |
double updatescore(set_t *set ,void *value); | |
set_t *syntax(index_t *index, set_t *set, list_iter_t *iter); |