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 <iostream> | |
#include <random> | |
#include <chrono> | |
#include <sstream> | |
#include <algorithm> | |
#include <vector> | |
#include <string> | |
#include <ostream> | |
#include <cstring> |
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 <iostream> | |
#include <unordered_map> | |
#include <fstream> | |
#include <cstdint> | |
#include <string> | |
using namespace std; | |
union ben{ | |
uint16_t num; | |
char c[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 <deque> | |
#include <iostream> | |
#include <unordered_map> | |
#include <fstream> | |
#include <cstdint> | |
#include <thread> | |
#include <string> | |
#include <cstring> | |
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
//Title: Depth first search in C++ | |
//Author: Shaun Cheng | |
//Date: 1/18/2016 | |
#include <iostream> | |
#include <array> | |
#include <vector> | |
#include <string> | |
#include <stack> | |
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
//This program is a simple demonstration of the speed difference between standard hashmap from C++ STL library vs. my simple hashmap allocated on the stack. My version is severely limited in for general use, but it is faster and can be run on Arduino devices, whereas there's no STL available for the arduino. | |
//To compile: g++ -std=c++11 StackHash.cpp | |
#include <iostream> | |
#include <unordered_set> | |
#include <ctime> | |
using namespace std; | |
//This default hash assumes T can be converted to int implicitly. | |
//The user can define how to map T to int with template specializations. |