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
#pragma once | |
#ifndef __QUEUE_H__ | |
#define __QUEUE_H__ | |
#include <exception> | |
const int INIT_CAPACITY = 4; | |
template<class T> | |
class Queue |
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
#pragma once | |
#ifndef __QUEUE_H__ | |
#define __QUEUE_H__ | |
#include <exception> | |
const int INIT_CAPACITY = 4; | |
template<class T> | |
class Queue |
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
/* | |
* 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] |
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
#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 |
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
//IMHO using Class for this task is an overkill | |
//So I am using just one struct and a few functions to operate with it | |
//NOTE: The input must start with ( and the first digit of the root must be at position 1 !!! | |
#include <iostream> | |
#include <vector> | |
#include <stack> | |
#include <string> | |
#include <algorithm> |
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 "stdafx.h" | |
#include "CppUnitTest.h" | |
#include "../MemoryAllocator/MemoryAllocator.h" | |
#include "../MemoryAllocator/MemoryAllocator.cpp" | |
using namespace Microsoft::VisualStudio::CppUnitTestFramework; | |
BEGIN_TEST_MODULE_ATTRIBUTE() | |
TEST_MODULE_ATTRIBUTE(L"Project", L"UnitTests") | |
TEST_MODULE_ATTRIBUTE(L"Date", L"24/01/2016") | |
END_TEST_MODULE_ATTRIBUTE() |
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 "MemoryAllocator.h" | |
#include <iostream> | |
#include <exception> | |
#include <new> | |
#include <assert.h> | |
#include <algorithm> | |
// ALWAYS a power of 2 !!! | |
const int ALIGNMENT = 8; |
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
#pragma once | |
#ifndef __MEMORY_ALLOCATOR_H__ | |
#define __MEMORY_ALLOCATOR_H__ | |
/*! \file MemoryAllocator.h | |
\brief Header file for the memory allocator. | |
@author Ivan Aleksandrov Ivanov | |
@version 1.0 |
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
#pragma once | |
struct node; | |
class Stack | |
{ | |
public: | |
Stack(); | |
~Stack(); | |
public: | |
bool push(int); | |
bool pop(); |
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
#pragma once | |
struct node; | |
class Queue | |
{ | |
public: | |
Queue(); | |
~Queue(); | |
public: |
OlderNewer