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 "csv.h" | |
#include <fstream> | |
#include <sstream> | |
#include <stdexcept> | |
Csv::Csv(const string &dir) | |
{ | |
directory = dir; | |
read(dir); | |
} |
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 <algorithm> | |
#include <iostream> | |
#include <vector> | |
#include <climits> | |
#include <string> | |
using namespace std; | |
vector<int> rc; | |
vector< vector<int> > DP, splits; |
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 <algorithm> | |
#include <iostream> | |
#include <vector> | |
#include <climits> | |
using namespace std; | |
vector<int> rc; | |
vector< vector<int> > DP; |
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 <vector> | |
#include <climits> | |
#include <algorithm> | |
using namespace std; | |
vector<int> rc; | |
int B(int i, int j) |
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 <functional> | |
#include <deque> | |
#include <vector> | |
using namespace std; | |
template<typename T> | |
deque<T> find_lis(const vector<T> &a, | |
function<bool(const T &, const T &)> comp = [&](const T &a, const T &b)->bool { return a < b; }) |
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
/* | |
sample run: | |
./measure-run-time < source-input.txt | |
output: | |
2 | |
4 | |
100 | |
** elapsed time: 0.523ms ** |
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
[bruceoutdoors@BruceManjaro bash]$ ./sjf.sh input.txt | |
Process Name: P1 | |
Arrival Time: 2 | |
Burst Time: 6 | |
Priority: 7 | |
Process Name: P2 | |
Arrival Time: 1 | |
Burst Time: 8 | |
Priority: 1 |
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
/** | |
* Signal.hpp | |
* - Simple implementation of the Signal and Slot (Observer pattern) mechanism. | |
* Requires C++11 compatible compiler. | |
* | |
* @author Lee Zhen Yong | |
*/ | |
#pragma once |
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
function Leaf(name) | |
{ | |
this.Name = name; | |
this.ParentBranch = null; | |
} | |
Branch.prototype = new Leaf(); | |
Branch.prototype.constructor = Branch; | |
Branch.prototype.Super = Leaf.prototype; |
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
TABLE TO TREE ALGORITHM PSEUDOCODE | |
The algorithm can traverse and read an infinite number of cells of an | |
infinite number of depth, as it reads the cells in a recursive fashion | |
with the base case as the leaf of the cells. Note that you should not | |
think this will work for graphs (there's simply no way you could | |
represent graphs in a table structure anyway). | |
Some Notes: | |
- A cell is either a leaf or a branch. |