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 "ProcessInfo.h" | |
#ifdef _WIN32 | |
#include "psapi.h" | |
#pragma comment(lib, "psapi.lib") | |
#include "tlhelp32.h" | |
#endif | |
#ifdef linux | |
#include <sys/sysinfo.h> |
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
template<typename K, typename V, typename HashFunc = std::hash<K>> | |
class HashTable { | |
public: | |
HashTable() { | |
curr_size = 0; | |
load_factor = 1.0; | |
capacity = 101; | |
slots = new Slot[capacity]; | |
} |
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
class BitArray { | |
public: | |
BitArray(unsigned capacity) { | |
bit_capacity = capacity; | |
byte_capacity = capacity / 8 + 1; | |
data = new char[capacity]; | |
memset(data, 0, byte_capacity); | |
} | |
~BitArray() { |
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
package filesystem; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.util.Collections; | |
import java.util.LinkedList; | |
import java.util.List; | |
import java.util.SortedSet; | |
import java.util.TreeSet; |