This file contains hidden or 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 <type_traits> | |
template<typename T, typename U> | |
constexpr bool same() | |
{ | |
return std::is_same<T,U>::value; | |
} | |
This file contains hidden or 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
// inspired by https://gist.github.com/oliora/b8207b4a74a6bb868ef4 | |
// a bit less text, less standard way | |
#include <cassert> | |
#include <utility> | |
#include <algorithm> | |
#include <type_traits> | |
template <typename T> | |
constexpr bool has_own_find(...) { return false; } |
This file contains hidden or 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
from random import sample | |
from time import time | |
def buble_sort(a): | |
for i in xrange(len(a)): | |
for j in xrange(1, len(a) - i): | |
if a[j-1] > a[j]: | |
temp = a[j] | |
a[j] = a[j-1] | |
a[j-1] = temp |
This file contains hidden or 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 <cstdint> | |
#include <cassert> | |
#include <typeinfo> | |
#include <algorithm> | |
#include <iterator> | |
#include <iostream> | |
#include <iomanip> | |
#include <chrono> | |
#include <ratio> | |
#include <array> |