Skip to content

Instantly share code, notes, and snippets.

#pragma once
#ifndef __GRAPH_H__
#define __GRAPH_H__
#include <exception>
#include <vector>
#include "Queue.h"
using std::vector;
//Use int instead of size_t so it can be used as a 2d dir vector
@IvanIvanoff
IvanIvanoff / fibbonaci.cpp
Created November 8, 2015 12:23
Three algorithms for calculating fibbonaci numbers
/*
* Source: http://fmi.wikidot.com/daa1
*/
#include <iostream>
#include <time.h>
typedef unsigned long long ull;
#define a(n) m1.pts[n]
#define b(n) m2.pts[n]
@IvanIvanoff
IvanIvanoff / circular_queue.cpp
Created November 6, 2015 14:28
Linear DS - Circular Queue
#pragma once
#ifndef __QUEUE_H__
#define __QUEUE_H__
#include <exception>
const int INIT_CAPACITY = 4;
template<class T>
class Queue
@IvanIvanoff
IvanIvanoff / circular_queue.cpp
Created November 6, 2015 14:27
SDP - Circular queue
#pragma once
#ifndef __QUEUE_H__
#define __QUEUE_H__
#include <exception>
const int INIT_CAPACITY = 4;
template<class T>
class Queue