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
// Code written by cire, hereby released into the public domain. | |
#include <sstream> | |
#include <iomanip> | |
#include <iostream> | |
#include <thread> | |
#include <atomic> | |
#include <chrono> | |
#include <array> |
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 <iomanip> | |
#include <iostream> | |
#include <vector> | |
#include "Sieve.h" | |
template <typename T> | |
void print( std::ostream& os, const T& t ) | |
{ | |
const unsigned perRow = 10 ; | |
const unsigned rowSize = 80 ; |
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 <vector> | |
#include "dosomething.h" | |
unsigned do_something( std::vector<unsigned>& v) | |
{ | |
unsigned total = 0 ; | |
for ( unsigned i=0; i<v.size(); ++i ) | |
total += (v[i] += i) ; | |
return total ; |
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 "grid.h" | |
Grid& Grid::flip(std::size_t pos) | |
{ | |
switch(pos) | |
{ | |
case 0: _grid.flip(0).flip(1).flip(3) ; break ; | |
case 1: _grid.flip(0).flip(1).flip(2).flip(4) ; break ; | |
case 2: _grid.flip(1).flip(2).flip(5) ; break ; |
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 <vector> | |
#include <queue> | |
#include <iostream> | |
#include <random> | |
#include <string> | |
#include "QueueManip.h" | |
void printSizes(const vector_type & v) |
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 <cstdlib> | |
#include <ctime> | |
#include <iostream> | |
#include <queue> | |
#include <chrono> | |
// merge sort example | |
class list_info ; | |
class node ; |