提交 c9fcfc29 编写于 作者: J Jason Park

add max_sum_path

上级 004d3e58
...@@ -5,9 +5,10 @@ function Array1DTracer(module) { ...@@ -5,9 +5,10 @@ function Array1DTracer(module) {
Array1DTracer.prototype = Object.create(Array2DTracer.prototype); Array1DTracer.prototype = Object.create(Array2DTracer.prototype);
Array1DTracer.prototype.constructor = Array1DTracer; Array1DTracer.prototype.constructor = Array1DTracer;
// Override var Array1D = {
Array1DTracer.prototype.createRandomData = function (N, min, max) { createRandomData: function (N, min, max) {
return Array2DTracer.prototype.createRandomData.call(this, 1, N, min, max)[0]; return Array2D.createRandomData(1, N, min, max)[0];
}
}; };
// Override // Override
......
...@@ -25,7 +25,8 @@ Array2DTracer.prototype.clear = function () { ...@@ -25,7 +25,8 @@ Array2DTracer.prototype.clear = function () {
clearTableColor(); clearTableColor();
}; };
Array2DTracer.prototype.createRandomData = function (N, M, min, max) { var Array2D = {
createRandomData: function (N, M, min, max) {
if (!N) N = 10; if (!N) N = 10;
if (!M) M = 10; if (!M) M = 10;
if (min === undefined) min = 1; if (min === undefined) min = 1;
...@@ -38,6 +39,7 @@ Array2DTracer.prototype.createRandomData = function (N, M, min, max) { ...@@ -38,6 +39,7 @@ Array2DTracer.prototype.createRandomData = function (N, M, min, max) {
} }
} }
return D; return D;
}
}; };
// Override // Override
......
...@@ -25,8 +25,8 @@ GraphTracer.prototype.clear = function () { ...@@ -25,8 +25,8 @@ GraphTracer.prototype.clear = function () {
clearGraphColor(); clearGraphColor();
}; };
// Override var Graph = {
GraphTracer.prototype.createRandomData = function (N, ratio) { createRandomData: function (N, ratio) {
if (!N) N = 5; if (!N) N = 5;
if (!ratio) ratio = .3; if (!ratio) ratio = .3;
var G = []; var G = [];
...@@ -38,6 +38,7 @@ GraphTracer.prototype.createRandomData = function (N, ratio) { ...@@ -38,6 +38,7 @@ GraphTracer.prototype.createRandomData = function (N, ratio) {
} }
} }
return G; return G;
}
}; };
GraphTracer.prototype.setTreeData = function (G, root) { GraphTracer.prototype.setTreeData = function (G, root) {
......
...@@ -16,8 +16,8 @@ WeightedGraphTracer.prototype.clear = function () { ...@@ -16,8 +16,8 @@ WeightedGraphTracer.prototype.clear = function () {
clearWeights(); clearWeights();
}; };
// Override var WeightedGraph = {
WeightedGraphTracer.prototype.createRandomData = function (N, ratio, min, max) { createRandomData: function (N, ratio, min, max) {
if (!N) N = 5; if (!N) N = 5;
if (!ratio) ratio = .3; if (!ratio) ratio = .3;
if (!min) min = 1; if (!min) min = 1;
...@@ -35,6 +35,7 @@ WeightedGraphTracer.prototype.createRandomData = function (N, ratio, min, max) { ...@@ -35,6 +35,7 @@ WeightedGraphTracer.prototype.createRandomData = function (N, ratio, min, max) {
} }
} }
return G; return G;
}
}; };
// Override // Override
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册