Skip to content

Instantly share code, notes, and snippets.

@erenon
erenon / doublelinked.c
Created November 19, 2010 20:46
Simple double linked list implementation in C
#include <stdio.h>
#include <stdlib.h>
#define SENTINEL_VALUE -1
typedef struct _list {
int value;
struct _list *prev;
struct _list *next;
} list;
@erenon
erenon / book.c
Created November 23, 2010 08:39
book list
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct _book {
char author[50];
int page;
int is_sentinel;
struct _book *next;
@erenon
erenon / listn.c
Created November 23, 2010 09:41
insert after n
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct _list {
int value;
struct _list *next;
} list;
@erenon
erenon / mutantbtree.c
Created November 29, 2010 20:30
mutant and balanced binary tree
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct _btree {
int value;
struct _btree *left;
struct _btree *right;
} btree;
@erenon
erenon / btree-latex.c
Created November 30, 2010 09:42
binary tree visualization
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct _btree {
int value;
struct _btree *left;
struct _btree *right;
} btree;
@erenon
erenon / mod.c
Created December 5, 2010 23:05 — forked from anonymous/mod.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define MAX_STRING_LENGTH 101
typedef struct {
char szerzo[101];
char cim[101];
unsigned kev;
char tema[101] ;
@erenon
erenon / Makefile
Created December 6, 2010 19:24
Makefile
C_SRCS += \
./library.c \
./functions.c \
./konyvtar.c
OBJS += \
./library.o \
./functions.o \
./konyvtar.o
@erenon
erenon / digit check.sh
Created December 9, 2010 12:31
Checks the digit resoult
#!/bin/bash
wget http://home.mit.bme.hu/~laczko/digit_eredmenyek.pdf -N -q
if [ -e "digit_md5" ]; then
md5sum digit_md5 --status -c
if [ $? != 0 ]; then
echo "===FRISSÜLT==="
fi
else
@erenon
erenon / find_memleak.h
Created May 6, 2011 17:42
find_memleak
#include <iostream>
#include <cstdlib>
#define new _NEW_WRAPPER() + new
using namespace std;
int _NEW_WRAPPER() {
cout << "hello" << endl;
return 0;
@erenon
erenon / list.hpp
Created May 14, 2011 18:20
Custom simple list implementation
#ifndef LIST_H_
#define LIST_H_
#include <cstddef>
template <typename T>
class List {
struct item {
T value;