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
template <typename Key, typename Value> | |
class RedBlackTree | |
{ | |
struct Node; | |
Node *nil = new Node(); | |
Node *root = nil; | |
// node structure | |
struct Node { | |
enum Color { RED, BLACK }; |
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 <ctime> | |
#include <cstdlib> | |
#include <stack> | |
#include <memory> | |
template <class K, class V> | |
class SkipList | |
{ | |
// key-value data | |
struct Pair |
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 <memory> | |
#include <vector> | |
#include <iostream> | |
template <unsigned N, typename Key, typename Value> | |
class BTree | |
{ | |
template <typename T> using vector = std::vector<T>; | |
template <typename T> using shared_ptr = std::shared_ptr<T>; |
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 <vector> | |
#include <cmath> | |
#include <iostream> | |
#include <string> | |
#define D(n) log2(n) | |
class FibonacciException | |
{ | |
using string = std::string; |
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 <memory> | |
#include <vector> | |
#include <cmath> | |
#include <iostream> | |
#define NIL (-1) | |
#define LOG2(x) ceil(log2(x)) | |
#define SQRT_C(x) (1<<static_cast<int>(ceil(LOG2(x)/2))) | |
#define SQRT_F(x) (1<<static_cast<int>(floor(LOG2(x)/2))) | |
#define HIGH(x) (x/SQRT_F(_u)) |
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 <vector> | |
#include <iostream> | |
#include <algorithm> | |
#include <limits> | |
#include <utility> | |
class StandardForm | |
{ | |
friend std::ostream &operator<<(std::ostream &out, const StandardForm &standrdform); | |
friend class SlackForm; |
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 <complex> | |
#include <vector> | |
#include <cmath> | |
#define COMPLEXE(u) std::complex<double>(cos(u),-sin(u)) | |
int bitwiseReverse(int num, int log2n) | |
{ | |
int ans = 0; | |
while (log2n--) { |
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 <vector> | |
#include <algorithm> | |
#include <iostream> | |
#include <utility> | |
#include <cmath> | |
#include <exception> | |
// verbose output | |
/*#define VERBOSE*/ |
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 <cstdio> | |
#include <vector> | |
#include <string> | |
#include <stack> | |
#include <cstdlib> | |
#include <ctime> | |
#include <queue> | |
using namespace std; |
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 <cstdio> | |
#include <vector> | |
#include <string> | |
#include <stack> | |
#include <cstdlib> | |
#include <ctime> | |
#include <queue> | |
#include <vector> | |
#include <algorithm> |
OlderNewer