less {filename}
| Navigation | |
|---|---|
SPACE |
forward one window |
b |
backward one window |
d |
forward half window |
| #include <iostream> | |
| using namespace std; | |
| class Singlton { | |
| public: | |
| static Singlton* getInstance() { | |
| static Singlton* instance = nullptr; | |
| #include <iostream> | |
| using namespace std; | |
| class Parts { | |
| string specification; | |
| public: | |
| // Constructor | |
| Parts(string specification) { |
| #include <iostream> | |
| #include <list> | |
| #include <unistd.h> | |
| using namespace std; | |
| enum Move { | |
| UP, | |
| RIGHT, | |
| DOWN, |
| #include <iostream> | |
| using namespace std; | |
| int magicSearch(int arr[], int start, int end) { | |
| if (start > end) | |
| return -1; | |
| int index = (start + end) / 2; | |
| #include <iostream> | |
| #include <map> | |
| using namespace std; | |
| static map<int, string> text { | |
| {0, ""}, | |
| {1, "one"}, | |
| {2, "two"}, | |
| {3, "three"}, |
| // ref: https://en.wikipedia.org/wiki/3SUM | |
| #include <iostream> | |
| #include <map> | |
| #include <algorithm> | |
| using namespace std; | |
| // Brute force solution O(n^3) | |
| bool sum3A(int arr[], int n) { |
| #include <iostream> | |
| #include <map> | |
| using namespace std; | |
| int fib(int n) { | |
| static map<int,int> mem{{1,1}, {0,1}}; | |
| if (mem.count(n) > 0) { |
| #include <iostream> | |
| #include <string> | |
| #include <vector> | |
| #include <list> | |
| using namespace std; | |
| template <class T> class Node { | |
| public: |
| #include <iostream> | |
| #include <string> | |
| #include <unordered_map> | |
| #include <list> | |
| using namespace std; | |
| template <class K, class V> class LRU { | |
| private: | |
| /* Members */ |