diff --git a/bundle/algorithms.browser.min.js b/bundle/algorithms.browser.min.js index 271bbe5..714a25c 100644 --- a/bundle/algorithms.browser.min.js +++ b/bundle/algorithms.browser.min.js @@ -1,3 +1,4 @@ -/* algorithms.js v0.9.1 | (c) 2015 Felipe Ribeiro | https://github.com/felipernb/algorithms.js/blob/master/LICENSE */ -!function(t,r){r.true=t,!function(e){if("object"==typeof t&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;"undefined"!=typeof window?n=window:"undefined"!=typeof r?n=r:"undefined"!=typeof self&&(n=self),n.algorithms=e()}}(function(){return function t(r,e,n){function i(s,a){if(!e[s]){if(!r[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var c=e[s]={exports:{}};r[s][0].call(c.exports,function(t){var e=r[s][1][t];return i(e?e:t)},c,c.exports,t,r,e,n)}return e[s].exports}for(var o="function"==typeof require&&require,s=0;st.vertices.size)))return{distance:{}}}}return{distance:e,previous:n}}r.exports=e},{}],2:[function(t,r){"use strict";var e=function(t,r){var e={},n={},i=[],o=0;t.vertices.forEach(function(r){t.neighbors(r).forEach(function(e){i.push({source:r,target:e,weight:t.edge(r,e)})}),e[r]=1/0,++o}),e[r]=0;var s,a,u,h=i.length;for(u=0;o>u;++u){for(var c=!1,f=0;h>f;f++)s=e[i[f].source]+i[f].weight,a=e[i[f].target],a>s&&(c=!0,e[i[f].target]=s,n[i[f].target]=i[f].source);if(!c)break}return u===o?{distance:{}}:{distance:e,previous:n}};r.exports=e},{}],3:[function(t,r){"use strict";var e=t("./breadth_first_search"),n=function(t,r){var n={},i={};return n[r]=0,e(t,r,{onTraversal:function(t,r){n[r]=n[t]+1,i[r]=t}}),{distance:n,previous:i}};r.exports=n},{"./breadth_first_search":4}],4:[function(t,r){"use strict";var e=t("../../data_structures/queue"),n=function(t,r){t=t||{},t.allowTraversal=t.allowTraversal||function(){var t=r.reduce(function(t,r){return t[r]=!0,t},{});return function(r,e){return t[e]?!1:(t[e]=!0,!0)}}();var e=function(){};return t.onTraversal=t.onTraversal||e,t.enterVertex=t.enterVertex||e,t.leaveVertex=t.leaveVertex||e,t},i=function(t,r,i){var o=new e;o.push(r),i=n(i,[r]);for(var s,a=function(t){i.allowTraversal(s,t)&&(i.onTraversal(s,t),o.push(t))};!o.isEmpty();)s=o.pop(),i.enterVertex(s),t.neighbors(s).forEach(a),i.leaveVertex(s)};r.exports=i},{"../../data_structures/queue":51}],5:[function(t,r){"use strict";var e=function(t,r){t=t||{},t.allowTraversal=t.allowTraversal||function(){var t={};return r.forEach(function(r){t[r]=!0}),function(r,e){return t[e]?!1:(t[e]=!0,!0)}}();var e=function(){};return t.beforeTraversal=t.beforeTraversal||e,t.afterTraversal=t.afterTraversal||e,t.enterVertex=t.enterVertex||e,t.leaveVertex=t.leaveVertex||e,t},n=function(t,r,n){i(t,r,e(n,[r]))},i=function t(r,e,n){n.enterVertex(e),r.neighbors(e).forEach(function(i){n.allowTraversal(e,i)&&(n.beforeTraversal(e,i),t(r,i,n),n.afterTraversal(e,i))}),n.leaveVertex(e)};r.exports=n},{}],6:[function(t,r){"use strict";function e(t,r){var e={},i={},o=new n;e[r]=0,t.vertices.forEach(function(t){t!==r&&(e[t]=1/0),o.insert(t,e[t])});for(var s,a=function(r){var n=e[s]+t.edge(s,r);nr&&o.push({ends:[r,e],weight:t.edge(r,e)})})}),o.sort(function(t,r){return t.weight-r.weight}).forEach(function(t){r.sameSubset(t.ends[0],t.ends[1])||(i.addEdge(t.ends[0],t.ends[1],t.weight),r.merge(t.ends[0],t.ends[1]))}),i};r.exports=i},{"../../data_structures/disjoint_set_forest":44,"../../data_structures/graph":46}],10:[function(t,r){"use strict";var e=t("../../data_structures/priority_queue"),n=t("../../data_structures/graph"),i=function(t){if(t.directed)throw new Error("Can't build MST of a directed graph.");var r=new n(!1),i=Object.create(null),o=new e;t.vertices.forEach(function(t){o.insert(t,1/0)});for(var s=function(r,e){var n=t.edge(r,e);nr||Math.floor(r)!==r)throw new Error("Power must be a positive integer or zero.");if(!r){if(void 0===i)throw new Error("The power is zero, but identity value not set.");return i}for(var o,s=function(t){o=void 0===o?t:n(o,t)},a=t;r;r>>>=1,a=n(a,a))1&r&&s(a);return o};r.exports=n},{}],14:[function(t,r){"use strict";var e=t("./fast_power"),n=function(t){return 2>t?t:n(t-1)+n(t-2)},i=function(t){for(var r=0,e=1,n=t,i=1;t>i;i++)n=e+r,r=e,e=n;return n},o=function(){var t=[0,1],r=function(e){return void 0===t[e]&&(t[e]=r(e-1)+r(e-2)),t[e]};return r}(),s=function(t){var r=(1+Math.sqrt(5))/2;return Math.floor(Math.pow(r,t)/Math.sqrt(5)+.5)},a=function(t){var r=[[1,1],[1,0]],n=function(t,r){return[[t[0][0]*r[0][0]+t[0][1]*r[1][0],t[0][0]*r[0][1]+t[0][1]*r[1][1]],[t[1][0]*r[0][0]+t[1][1]*r[1][0],t[1][0]*r[0][1]+t[1][1]*r[1][1]]]},i=e(r,t,n,[[1,0],[0,1]]);return i[0][1]};i.exponential=n,i.withMemoization=o,i.direct=s,i.logarithmic=a,r.exports=i},{"./fast_power":13}],15:[function(t,r){"use strict";var e=function(t){for(var r=t.length-1;r>0;r--){var e=Math.floor(Math.random()*(r+1)),n=t[r];t[r]=t[e],t[e]=n}};r.exports=e},{}],16:[function(t,r){"use strict";var e=function(t,r){var e=t;for(t=Math.max(t,r),r=Math.min(e,r);0!==r;)e=r,r=t%r,t=e;return t},n=function(t,r){if(0===t)return r;if(0===r)return t;var e;for(e=0;0===(1&(t|r));++e)t>>=1,r>>=1;for(;0===(1&t);)t>>=1;var n;do{for(;0===(1&r);)r>>=1;t>r&&(n=r,r=t,t=n),r-=t}while(0!==r);return t<n?s=i:o=i;while(Math.abs(n-t)>r&&e>a);var u=Math.round(i);return u*u===t&&(i=u),i};r.exports=e},{}],19:[function(t,r){"use strict";var e=t("../../util/comparator"),n=function(t,r){if(!t.length)return!1;for(var n=new e(r),i=t.length-1;i&&n.greaterThanOrEqual(t[i-1],t[i]);)i-=1;if(!i)return!1;for(var o=t[--i],s=t.length-1;n.lessThanOrEqual(t[s],o);)s-=1;t[i]=t[s],t[s]=o;for(var a=i,u=t.length;++a<--u;){var h=t[a];t[a]=t[u],t[u]=h}return!0};r.exports=n},{"../../util/comparator":60}],20:[function(t,r){"use strict";var e=function(t){if(0===t.length)return[];var r,e=[],n=[];for(r=0;rt.length)throw new Error("Sample size exceeds the total number of elements.");for(var e=t.slice(0,r),n=r;ni&&(e[i]=t[n])}return e};r.exports=e},{}],22:[function(t,r){"use strict";var e=function(t){var r=t.reduce(function(t,r){return t[r]=t[r]+1||1,t},{}),e=Object.keys(r).map(function(e){return r[e]/t.length});return e.reduce(function(t,r){return t-r*Math.log(r)},0)*Math.LOG2E};r.exports=e},{}],23:[function(t,r){"use strict";var e=t("../../data_structures/queue.js"),n=function(t,r){var n=new e;n.push(t);for(var i;!n.isEmpty();)i=n.pop(),r(i.value),i.left&&n.push(i.left),i.right&&n.push(i.right)};r.exports=n},{"../../data_structures/queue.js":51}],24:[function(t,r){"use strict";var e=function(t,r){for(var e=0,n=t.length-1;n>=e;){var i=(n-e>>1)+e;if(t[i]===r)return i;t[i]a;a++){for(var u=0,h=0;o>h;h++)if(n.greaterThan(t[h],t[h+1])){var c=t[h];t[h]=t[h+1],t[h+1]=c,u=h,s=!0}if(!s)return t;o=u}return t};r.exports=n},{"../../util/comparator":60}],27:[function(t,r){"use strict";var e=function(t){var r,e=n(t),i=[],o=t.length;for(r=0;o>r;r++){var s=t[r].key;void 0===i[s]&&(i[s]=[]),i[s].push(t[r])}t=[];var a=0;for(r=0;e>=r;r++)if(void 0!==i[r])for(var u=i[r].length,h=0;u>h;h++)t[a++]=i[r][h];return t},n=function(t){for(var r=t[0].key,e=t.length,n=1;e>n;n++)t[n].key>r&&(r=t[n].key);return r};r.exports=e},{}],28:[function(t,r){"use strict";var e=t("../../data_structures/heap").MinHeap,n=function(t,r){var n=new e(r);n.heapify(t);for(var i=[];!n.isEmpty();)i.push(n.extract());return i};r.exports=n},{"../../data_structures/heap":48}],29:[function(t,r){"use strict";var e=t("../../util/comparator"),n=function(t,r){for(var n=new e(r),i=1,o=t.length;o>i;i++){for(var s=t[i],a=i;a>0&&n.lessThan(s,t[a-1]);)t[a]=t[a-1],a--;t[a]=s}return t};r.exports=n},{"../../util/comparator":60}],30:[function(t,r){"use strict";var e=t("../../util/comparator"),n=function(t,r){var n=new e(r);return function t(r){if(r.length>1){var e=r.length>>1,o=t(r.slice(0,e)),s=t(r.slice(e));r=i(o,s,n)}return r}(t)},i=function(t,r,e){for(var n=0,i=0,o=[];ne;){var s=i(r,n,e,o);o-s>s-e?(t(r,e,s-1),e=s+1):(t(r,s+1,o),o=s-1)}return r}(t,0,t.length-1)},i=function(t,r,e,n){o(t,Math.floor(Math.random()*(n-e))+e,n);for(var i=n,s=e,a=e;n>a;a++)r.lessThan(t[a],t[i])&&(o(t,a,s),s++);return o(t,s,i),s},o=function(t,r,e){var n=t[e];t[e]=t[r],t[r]=n};r.exports=n},{"../../util/comparator":60}],32:[function(t,r){"use strict";var e=function(t){for(var r=i(t),e=0===r?1:1+Math.floor(Math.log(r)/Math.log(10)),o=0;e>o;o++)t=n(t,o);return t},n=function(t,r){var e,n=t.length,i=[];for(e=0;10>e;e++)i[e]=[];for(e=0;n>e;e++){var o=parseInt((t[e].key/Math.pow(10,r)).toFixed(r))%10;i[o].push(t[e])}var s=0;for(e=0;10>e;e++)for(var a=i[e].length,u=0;a>u;u++)t[s++]=i[e][u];return t},i=function(t){for(var r,e=1;er)&&(r=t[e].key);return r};r.exports=e},{}],33:[function(t,r){"use strict";var e=t("../../util/comparator"),n=function(t,r){for(var n=new e(r),i=t.length,o=0;i-1>o;o++){for(var s=o,a=o+1;i>a;a++)n.greaterThan(t[s],t[a])&&(s=a);if(s!==o){var u=t[o];t[o]=t[s],t[s]=u}}return t};r.exports=n},{"../../util/comparator":60}],34:[function(t,r){"use strict";var e=t("../../util/comparator"),n=function(t,r){for(var n=new e(r),i=0,o=t.length-1,s=parseInt((o-i+1)/2),a=0,u=0,h=0;s>=1;){for(a=i+s;o>=a;a+=1){for(h=t[a],u=a-s;u>=i&&n.greaterThan(t[u],h);)t[u+s]=t[u],u-=s;t[u+s]=h}s=parseInt(s/2)}return t};r.exports=n},{"../../util/comparator":60}],35:[function(t,r){"use strict";var e=function(t,r){if(t.length!==r.length)throw new Error("Strings must be equal in length");for(var e=0,n=0;n>>0).toString(2).length,i=function(t){var r=[],e=0,i=0;return t.split("").forEach(function(t){e=e<<1|t,i+=1,i===n&&(r.push(e),e=i=0)}),i?r.push(e,i):r.push(n),r},o=function(t){if(!t.length)return"";if(1===t.length)throw new Error("Compressed array must be either empty or at least 2 blocks big.");var r=new Array(n+1).join(0),e=t.slice(0,-2).map(function(t){return(r+(t>>>0).toString(2)).slice(-r.length)}).join(""),i=t.slice(-1)[0],o=t.slice(-2)[0];return e+=(r+(o>>>0).toString(2)).slice(-i)};e.encode=function(t,r){if(!t.length)return{encoding:{},value:r?[]:""};var e={};t.split("").forEach(function(t){e[t]=(e[t]||0)+1});var n=Object.keys(e).map(function(t){return{char:t,count:e[t]}}),o=function(t,r){return t.count-r.count},s=function(t,r){return t&&(r&&t.count1;--f){var l=c(),p=c();l.code="0",p.code="1";var g={count:l.count+p.count,parts:[l,p]};a.push(g)}var d=c();d.code=n.length>1?"":"0",function t(r){if(r.parts){var e=r.parts[0],n=r.parts[1];e.code+=r.code,n.code+=r.code,t(e),t(n)}}(d);var v=n.reduce(function(t,r){return t[r.char]=r.code.split("").reverse().join(""),t},{}),m=t.split("").map(function(t){return v[t]}).join("");return{encoding:v,value:r?i(m):m}},e.decode=function(t,r){Array.isArray(r)&&(r=o(r));var e=Object.keys(t).reduce(function(r,e){return r[t[e]]=e,r},{}),n=[],i=r.split("").reduce(function(t,r){t+=r;var i=e[t];return i&&(n.push(i),t=""),t},"");if(i)throw new Error("Invalid string to decode.");return n.join("")},r.exports=e},{}],37:[function(t,r){"use strict";var e=function(t,r){for(var e=t.length,i=r.length,o=0,s=0,a=n(r);e>o+s;)if(r[s]===t[o+s]){if(s===i-1)return o;++s}else a[s]>=0?(s=a[s],o=o+s-a[s]):(s=0,++o);return e},n=function(t){var r=t.length,e=[],n=2,i=0;for(e[0]=-1,e[1]=0;r>n;)t[n-1]===t[i]?(++i,e[n]=i,++n):i>0?i=e[i]:(e[n]=0,++n);return e};r.exports=e},{}],38:[function(t,r){"use strict";var e=function(t,r){var e,n,i=[];for(e=0;e<=t.length;e++)i[e]=[],i[e][0]=e;for(n=0;n<=r.length;n++)i[0][n]=n;for(e=1;e<=t.length;e++)for(n=1;n<=r.length;n++)i[e][n]=Math.min(i[e-1][n-1],i[e-1][n],i[e][n-1])+(t[e-1]!==r[n-1]?1:0);return i[t.length][r.length]};r.exports=e},{}],39:[function(t,r){"use strict";var e=function(t,r){var e,n,i=new Array(t.length+1);for(e=0;e<=t.length;e++)i[e]=new Int32Array(r.length+1);for(e=1;e<=t.length;e++)for(n=1;n<=r.length;n++)i[e][n]=t[e-1]===r[n-1]?i[e-1][n-1]+1:Math.max(i[e][n-1],i[e-1][n]);e=t.length,n=r.length;for(var o="";0!==i[e][n];)t[e-1]===r[n-1]?(o=t[e-1]+o,e--,n--):i[e-1][n]>i[e][n-1]?e--:n--;return o};r.exports=e},{}],40:[function(t,r){"use strict";var e=function(t,r){var e,n,i=new Array(t.length+1);for(e=0;e<=t.length+1;e++)i[e]=new Int32Array(r.length+1);var o={},s=0;for(e=1;e<=t.length;e++)for(n=1;n<=r.length;n++)t[e-1]===r[n-1]?(i[e][n]=i[e-1][n-1]+1,i[e][n]>s&&(o.i=e,o.j=n,s=i[e][n])):i[e][n]=0;var a="";return s&&(a=t.substring(o.i-s,o.i)),a};r.exports=e},{}],41:[function(t,r){"use strict";var e=997,n=function(t,r){if(0===r.length)return 0;for(var n,o=i(r),s=t.substring(0,r.length),a=r.length;a<=t.length;a++)if(void 0===n?n=i(s):(n-=s.charCodeAt(0)*Math.pow(e,r.length-1),n*=e,n+=t.charCodeAt(a),s=s.substring(1)+t[a]),o===n&&r===s)return a===r.length?0:a-r.length+1;return-1},i=function(t){for(var r=0,n=0;n2&&t.apply(this,[].slice.call(arguments,1)),this._introduce(r),this._introduce(e);var n=this.root(r),i=this.root(e);return this._ranks[n]0;t-=t&-t)r+=this._elements[t];return r},e.prototype.rangeSum=function(t,r){return this.prefixSum(r)-this.prefixSum(t-1)},r.exports=e},{}],46:[function(t,r){"use strict";function e(t){this.directed=void 0===t?!0:!!t,this.adjList=Object.create(null),this.vertices=new n}var n=t("./set"),i=function(t){return""+t};e.prototype.addVertex=function(t){if(t=i(t),this.vertices.contains(t))throw new Error('Vertex "'+t+'" has already been added');this.vertices.add(t),this.adjList[t]=Object.create(null)},e.prototype.addEdge=function(t,r,e){t=i(t),r=i(r),e=void 0===e?1:e,this.adjList[t]||this.addVertex(t),this.adjList[r]||this.addVertex(r),this.adjList[t][r]=(this.adjList[t][r]||0)+e,this.directed||(this.adjList[r][t]=(this.adjList[r][t]||0)+e)},e.prototype.neighbors=function(t){return Object.keys(this.adjList[i(t)])},e.prototype.edge=function(t,r){return this.adjList[i(t)][i(r)]},r.exports=e},{"./set":52}],47:[function(t,r){"use strict";function e(t){this._table=new Array(t||64),this._items=0,Object.defineProperty(this,"capacity",{get:function(){return this._table.length}}),Object.defineProperty(this,"size",{get:function(){return this._items}})}var n=t("./linked_list");e.prototype.hash=function(t){"string"!=typeof t&&(t=JSON.stringify(t));for(var r=0,e=0;e1&&(r=t>>1)&&this._comparator.greaterThan(this._elements[r],this._elements[t]);t=r)this._swap(r,t)},e.prototype._siftDown=function(t){var r;for(t=t||1;(r=t<<1)<=this.n&&(r+1<=this.n&&this._comparator.lessThan(this._elements[r+1],this._elements[r])&&r++,!this._comparator.lessThan(this._elements[t],this._elements[r]));t=r)this._swap(t,r)},e.prototype.heapify=function(t){t&&(this._elements=t,this._elements.unshift(null));for(var r=this.n>>1;r>0;r--)this._siftDown(r)},e.prototype.forEach=function(t){var r,e=[];for(r=0;r0;r--)t(this.extract());this._elements=e},n.prototype=new e,r.exports={MinHeap:e,MaxHeap:n}},{"../util/comparator":60}],49:[function(t,r){"use strict";function e(){this._length=0,this.head=null,this.tail=null,Object.defineProperty(this,"length",{get:function(){return this._length}.bind(this)})}function n(t){this.value=t,this.prev=null,this.next=null}e.prototype.isEmpty=function(){return 0===this.length},e.prototype.add=function(t,r){if(r>this.length||0>r)throw new Error("Index out of bounds");var e=new n(t);if(void 0!==r&&r=this.length||0>t)throw new Error("Index out of bounds");for(var r=this.head,e=1;t>=e;e++)r=r.next;return r},e.prototype.del=function(t){if(t>=this.length||0>t)throw new Error("Index out of bounds");this.delNode(this.getNode(t))},e.prototype.delNode=function(t){t===this.tail?this.tail=t.prev:t.next.prev=t.prev,t===this.head?this.head=t.next:t.prev.next=t.next,this._length--},e.prototype.forEach=function(t){for(var r=this.head;r;)t(r.value),r=r.next},r.exports=e},{}],50:[function(t,r){"use strict";function e(t){var r=this;n.call(this,function(t,e){return r.priority(t)t?-1:1},e.prototype.lessThan=function(t,r){return this.compare(t,r)<0},e.prototype.lessThanOrEqual=function(t,r){return this.lessThan(t,r)||this.equal(t,r)},e.prototype.greaterThan=function(t,r){return this.compare(t,r)>0},e.prototype.greaterThanOrEqual=function(t,r){return this.greaterThan(t,r)||this.equal(t,r)},e.prototype.equal=function(t,r){return 0===this.compare(t,r)},e.prototype.reverse=function(){var t=this.compare;this.compare=function(r,e){return t(e,r)}},r.exports=e},{}]},{},[55])(55)})}({},function(){return this}()); \ No newline at end of file +/* algorithms.js v0.10.0 | (c) 2015 Felipe Ribeiro | https://github.com/felipernb/algorithms.js/blob/master/LICENSE */ +!function(t,r){r.true=t,function(e){if("object"==typeof t&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i;i="undefined"!=typeof window?window:"undefined"!=typeof r?r:"undefined"!=typeof self?self:this,i.algorithms=e()}}(function(){return function t(r,e,i){function n(s,a){if(!e[s]){if(!r[s]){var h="function"==typeof require&&require;if(!a&&h)return h(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=e[s]={exports:{}};r[s][0].call(l.exports,function(t){var e=r[s][1][t];return n(e?e:t)},l,l.exports,t,r,e,i)}return e[s].exports}for(var o="function"==typeof require&&require,s=0;s=1;--e)i[e]+=i[e-1];for(r=0;r=0;--r)e.x+=this.p[r].x*o[r]*n,e.y+=this.p[r].y*o[r]*n,n*=1-t;return e},r.exports=e},{}],2:[function(t,r){"use strict";function e(t,r){var e={},i={},n={},o={},s={},a=0,h=1;e[r]=0,n[0]=r,o[r]=!0,s[r]=1,t.vertices.forEach(function(t){t!==r&&(e[t]=1/0,o[t]=!1,s[t]=0)});for(var u;a!==h;){u=n[a++],o[u]=!1;for(var l=t.neighbors(u),c=0;ct.vertices.size)))return{distance:{}}}}return{distance:e,previous:i}}r.exports=e},{}],3:[function(t,r){"use strict";var e=function(t,r){var e={},i={},n=[],o=0;t.vertices.forEach(function(r){t.neighbors(r).forEach(function(e){n.push({source:r,target:e,weight:t.edge(r,e)})}),e[r]=1/0,++o}),e[r]=0;var s,a,h,u=n.length;for(h=0;o>h;++h){for(var l=!1,c=0;u>c;c++)s=e[n[c].source]+n[c].weight,a=e[n[c].target],a>s&&(l=!0,e[n[c].target]=s,i[n[c].target]=n[c].source);if(!l)break}return h===o?{distance:{}}:{distance:e,previous:i}};r.exports=e},{}],4:[function(t,r){"use strict";var e=t("./breadth_first_search"),i=function(t,r){var i={},n={};return i[r]=0,e(t,r,{onTraversal:function(t,r){i[r]=i[t]+1,n[r]=t}}),{distance:i,previous:n}};r.exports=i},{"./breadth_first_search":5}],5:[function(t,r){"use strict";var e=t("../../data_structures/queue"),i=function(t,r){t=t||{},t.allowTraversal=t.allowTraversal||function(){var t=r.reduce(function(t,r){return t[r]=!0,t},{});return function(r,e){return t[e]?!1:(t[e]=!0,!0)}}();var e=function(){};return t.onTraversal=t.onTraversal||e,t.enterVertex=t.enterVertex||e,t.leaveVertex=t.leaveVertex||e,t},n=function(t,r,n){var o=new e;o.push(r),n=i(n,[r]);for(var s,a=function(t){n.allowTraversal(s,t)&&(n.onTraversal(s,t),o.push(t))};!o.isEmpty();)s=o.pop(),n.enterVertex(s),t.neighbors(s).forEach(a),n.leaveVertex(s)};r.exports=n},{"../../data_structures/queue":58}],6:[function(t,r){"use strict";var e=function(t,r){t=t||{},t.allowTraversal=t.allowTraversal||function(){var t={};return r.forEach(function(r){t[r]=!0}),function(r,e){return t[e]?!1:(t[e]=!0,!0)}}();var e=function(){};return t.beforeTraversal=t.beforeTraversal||e,t.afterTraversal=t.afterTraversal||e,t.enterVertex=t.enterVertex||e,t.leaveVertex=t.leaveVertex||e,t},i=function(t,r,i){n(t,r,e(i,[r]))},n=function t(r,e,i){i.enterVertex(e),r.neighbors(e).forEach(function(n){i.allowTraversal(e,n)&&(i.beforeTraversal(e,n),t(r,n,i),i.afterTraversal(e,n))}),i.leaveVertex(e)};r.exports=i},{}],7:[function(t,r){"use strict";function e(t,r){var e={},n={},o=new i;e[r]=0,t.vertices.forEach(function(t){t!==r&&(e[t]=1/0),o.insert(t,e[t])});for(var s,a=function(r){var i=e[s]+t.edge(s,r);ir&&o.push({ends:[r,e],weight:t.edge(r,e)})})}),o.sort(function(t,r){return t.weight-r.weight}).forEach(function(t){r.sameSubset(t.ends[0],t.ends[1])||(n.addEdge(t.ends[0],t.ends[1],t.weight),r.merge(t.ends[0],t.ends[1]))}),n};r.exports=n},{"../../data_structures/disjoint_set_forest":51,"../../data_structures/graph":53}],11:[function(t,r){"use strict";var e=t("../../data_structures/priority_queue"),i=t("../../data_structures/graph"),n=function(t){if(t.directed)throw new Error("Can't build MST of a directed graph.");var r=new i(!1),n=Object.create(null),o=new e;t.vertices.forEach(function(t){o.insert(t,1/0)});for(var s=function(r,e){var i=t.edge(r,e);i>1:3*t+1}function i(t){var r=[];do t=e(t),r.push(t);while(1!==t);return r}var n={1:1};r.exports={generate:i,calculate:e}},{}],14:[function(t,r){"use strict";var e=function(t,r){for(var e,i,n=0,o=1,s=1,a=0,h=r,u=t;0!==h;)e=Math.floor(u/h),i=h,h=u-e*h,u=i,i=n,n=o-e*n,o=i,i=s,s=a-e*s,a=i;return{x:o,y:a}};r.exports=e},{}],15:[function(t,r){"use strict";var e=function(t,r){return t*r},i=function(t,r,i,n){if(void 0===i&&(i=e,n=1),0>r||Math.floor(r)!==r)throw new Error("Power must be a positive integer or zero.");if(!r){if(void 0===n)throw new Error("The power is zero, but identity value not set.");return n}for(var o,s=function(t){o=void 0===o?t:i(o,t)},a=t;r;r>>>=1,a=i(a,a))1&r&&s(a);return o};r.exports=i},{}],16:[function(t,r){"use strict";var e=t("./fast_power"),i=function(t){return 2>t?t:i(t-1)+i(t-2)},n=function(t){for(var r=0,e=1,i=t,n=1;t>n;n++)i=e+r,r=e,e=i;return i},o=function(){var t=[0,1],r=function(e){return void 0===t[e]&&(t[e]=r(e-1)+r(e-2)),t[e]};return r}(),s=function(t){var r=(1+Math.sqrt(5))/2;return Math.floor(Math.pow(r,t)/Math.sqrt(5)+.5)},a=function(t){var r=[[1,1],[1,0]],i=function(t,r){return[[t[0][0]*r[0][0]+t[0][1]*r[1][0],t[0][0]*r[0][1]+t[0][1]*r[1][1]],[t[1][0]*r[0][0]+t[1][1]*r[1][0],t[1][0]*r[0][1]+t[1][1]*r[1][1]]]},n=e(r,t,i,[[1,0],[0,1]]);return n[0][1]};n.exponential=i,n.withMemoization=o,n.direct=s,n.logarithmic=a,r.exports=n},{"./fast_power":15}],17:[function(t,r){"use strict";var e=function(t){for(var r=t.length-1;r>0;r--){var e=Math.floor(Math.random()*(r+1)),i=t[r];t[r]=t[e],t[e]=i}};r.exports=e},{}],18:[function(t,r){"use strict";var e=function(t,r){var e=t;for(t=Math.max(t,r),r=Math.min(e,r);0!==r;)e=r,r=t%r,t=e;return t},i=function(t,r){if(0===t)return r;if(0===r)return t;var e;for(e=0;0===(1&(t|r));++e)t>>=1,r>>=1;for(;0===(1&t);)t>>=1;var i;do{for(;0===(1&r);)r>>=1;t>r&&(i=r,r=t,t=i),r-=t}while(0!==r);return t<e;e++)r=t[e],r>i&&(i=r),o>r&&(o=r);return i-o};r.exports=e},{}],20:[function(t,r){"use strict";var e=t("./gcd.js"),i=function(t,r,e){return 0===r||0===e?0:(r=Math.abs(r),e=Math.abs(e),r/t(r,e)*e)},n=i.bind(null,e),o=i.bind(null,e.binary),s=n;s.binary=o,r.exports=s},{"./gcd.js":18}],21:[function(t,r){"use strict";var e=function(t,r,e){r=r||1e-7,e=e||1e7;var i,n,o=t,s=0,a=0;do a++,n=(o-s)/2+s,i=n*n,t>i?s=n:o=n;while(Math.abs(i-t)>r&&e>a);var h=Math.round(n);return h*h===t&&(n=h),n};r.exports=e},{}],22:[function(t,r){"use strict";var e=t("../../util/comparator"),i=function(t,r){if(!t.length)return!1;for(var i=new e(r),n=t.length-1;n&&i.greaterThanOrEqual(t[n-1],t[n]);)n-=1;if(!n)return!1;for(var o=t[--n],s=t.length-1;i.lessThanOrEqual(t[s],o);)s-=1;t[n]=t[s],t[s]=o;for(var a=n,h=t.length;++a<--h;){var u=t[a];t[a]=t[h],t[h]=u}return!0};r.exports=i},{"../../util/comparator":69}],23:[function(t,r){"use strict";var e=function(t){if(0===t.length)return[];var r,e=[],i=[];for(r=0;r=r?!1:t(r)},i=function(t){for(var r=2;t>r;++r)if(t%r===0)return!1;return!0},n=function(t){for(var r=Math.sqrt(t),e=2;r>=e;++e)if(t%e===0)return!1;return!0};r.exports={naiveTest:e.bind(null,i),trialDivisionTest:e.bind(null,n)}},{}],25:[function(t,r){"use strict";var e=function(t,r){if(r>t.length)throw new Error("Sample size exceeds the total number of elements.");for(var e=t.slice(0,r),i=r;in&&(e[n]=t[i])}return e};r.exports=e},{}],26:[function(t,r){"use strict";var e=function(t){var r=t.reduce(function(t,r){return t[r]=t[r]+1||1,t},{}),e=Object.keys(r).map(function(e){return r[e]/t.length});return e.reduce(function(t,r){return t-r*Math.log(r)},0)*Math.LOG2E};r.exports=e},{}],27:[function(t,r){"use strict";var e=t("../../data_structures/queue.js"),i=function(t,r){var i=new e;i.push(t);for(var n;!i.isEmpty();)n=i.pop(),r(n.value),n.left&&i.push(n.left),n.right&&i.push(n.right)};r.exports=i},{"../../data_structures/queue.js":58}],28:[function(t,r){"use strict";var e=function(t,r){for(var e=0,i=t.length-1;i>=e;){var n=(i-e>>1)+e;if(t[n]===r)return n;t[n]i;){var n=r+(e-r)/3,o=e-(e-r)/3;t(n)a;a++){for(var h=0,u=0;o>u;u++)if(i.greaterThan(t[u],t[u+1])){var l=t[u];t[u]=t[u+1],t[u+1]=l,h=u,s=!0}if(!s)return t;o=h}return t};r.exports=i},{"../../util/comparator":69}],32:[function(t,r){"use strict";var e=function(t){var r,e=i(t),n=[],o=t.length;for(r=0;o>r;r++){var s=t[r].key;void 0===n[s]&&(n[s]=[]),n[s].push(t[r])}t=[];var a=0;for(r=0;e>=r;r++)if(void 0!==n[r])for(var h=n[r].length,u=0;h>u;u++)t[a++]=n[r][u];return t},i=function(t){for(var r=t[0].key,e=t.length,i=1;e>i;i++)t[i].key>r&&(r=t[i].key);return r};r.exports=e},{}],33:[function(t,r){"use strict";var e=t("../../data_structures/heap").MinHeap,i=function(t,r){var i=new e(r);i.heapify(t);for(var n=[];!i.isEmpty();)n.push(i.extract());return n};r.exports=i},{"../../data_structures/heap":55}],34:[function(t,r){"use strict";var e=t("../../util/comparator"),i=function(t,r){for(var i=new e(r),n=1,o=t.length;o>n;n++){for(var s=t[n],a=n;a>0&&i.lessThan(s,t[a-1]);)t[a]=t[a-1],a--;t[a]=s}return t};r.exports=i},{"../../util/comparator":69}],35:[function(t,r){"use strict";var e=t("../../util/comparator"),i=function(t,r){var i=new e(r);return function t(r){if(r.length>1){var e=r.length>>1,o=t(r.slice(0,e)),s=t(r.slice(e));r=n(o,s,i)}return r}(t)},n=function(t,r,e){for(var i=0,n=0,o=[];ie;){var s=n(r,i,e,o);o-s>s-e?(t(r,e,s-1),e=s+1):(t(r,s+1,o),o=s-1)}return r}(t,0,t.length-1)},n=function(t,r,e,i){o(t,Math.floor(Math.random()*(i-e))+e,i);for(var n=i,s=e,a=e;i>a;a++)r.lessThan(t[a],t[n])&&(o(t,a,s),s++);return o(t,s,n),s},o=function(t,r,e){var i=t[e];t[e]=t[r],t[r]=i};r.exports=i},{"../../util/comparator":69}],37:[function(t,r){"use strict";var e=function(t){for(var r=n(t),e=0===r?1:1+Math.floor(Math.log(r)/Math.log(10)),o=0;e>o;o++)t=i(t,o);return t},i=function(t,r){var e,i=t.length,n=[];for(e=0;10>e;e++)n[e]=[];for(e=0;i>e;e++){var o=parseInt((t[e].key/Math.pow(10,r)).toFixed(r))%10;n[o].push(t[e])}var s=0;for(e=0;10>e;e++)for(var a=n[e].length,h=0;a>h;h++)t[s++]=n[e][h];return t},n=function(t){for(var r,e=1;er)&&(r=t[e].key);return r};r.exports=e},{}],38:[function(t,r){"use strict";var e=t("../../util/comparator"),i=function(t,r){for(var i=new e(r),n=t.length,o=0;n-1>o;o++){for(var s=o,a=o+1;n>a;a++)i.greaterThan(t[s],t[a])&&(s=a);if(s!==o){var h=t[o];t[o]=t[s],t[s]=h}}return t};r.exports=i},{"../../util/comparator":69}],39:[function(t,r){"use strict";var e=t("../../util/comparator"),i=function(t,r){for(var i=new e(r),n=0,o=t.length-1,s=parseInt((o-n+1)/2),a=0,h=0,u=0;s>=1;){for(a=n+s;o>=a;a+=1){for(u=t[a],h=a-s;h>=n&&i.greaterThan(t[h],u);)t[h+s]=t[h],h-=s;t[h+s]=u}s=parseInt(s/2)}return t};r.exports=i},{"../../util/comparator":69}],40:[function(t,r){"use strict";function e(t,r){var e=new i(r),n=t.length-1,o=0;for(o;n>o;o++){var s=t[o],a=t[o+1];e.greaterThan(s,a)&&(t[o+1]=s,t[o]=a,o=-1)}return t}var i=t("../../util/comparator");r.exports=e},{"../../util/comparator":69}],41:[function(t,r){"use strict";var e=function(t,r){if(t.length!==r.length)throw new Error("Strings must be equal in length");for(var e=0,i=0;i>>0).toString(2).length,n=function(t){var r=[],e=0,n=0;return t.split("").forEach(function(t){e=e<<1|t,n+=1,n===i&&(r.push(e),e=n=0)}),n?r.push(e,n):r.push(i),r},o=function(t){if(!t.length)return"";if(1===t.length)throw new Error("Compressed array must be either empty or at least 2 blocks big.");var r=new Array(i+1).join(0),e=t.slice(0,-2).map(function(t){return(r+(t>>>0).toString(2)).slice(-r.length)}).join(""),n=t.slice(-1)[0],o=t.slice(-2)[0];return e+=(r+(o>>>0).toString(2)).slice(-n)};e.encode=function(t,r){if(!t.length)return{encoding:{},value:r?[]:""};var e={};t.split("").forEach(function(t){e[t]=(e[t]||0)+1});var i=Object.keys(e).map(function(t){return{char:t,count:e[t]}}),o=function(t,r){return t.count-r.count},s=function(t,r){return t&&(r&&t.count1;--c){var f=l(),p=l();f.code="0",p.code="1";var g={count:f.count+p.count,parts:[f,p]};a.push(g)}var d=l();d.code=i.length>1?"":"0",function t(r){if(r.parts){var e=r.parts[0],i=r.parts[1];e.code+=r.code,i.code+=r.code,t(e),t(i)}}(d);var v=i.reduce(function(t,r){return t[r.char]=r.code.split("").reverse().join(""),t},{}),m=t.split("").map(function(t){return v[t]}).join("");return{encoding:v,value:r?n(m):m}},e.decode=function(t,r){Array.isArray(r)&&(r=o(r));var e=Object.keys(t).reduce(function(r,e){return r[t[e]]=e,r},{}),i=[],n=r.split("").reduce(function(t,r){t+=r;var n=e[t];return n&&(i.push(n),t=""),t},"");if(n)throw new Error("Invalid string to decode.");return i.join("")},r.exports=e},{}],43:[function(t,r){"use strict";var e=function(t,r){for(var e=t.length,n=r.length,o=0,s=0,a=i(r);e>o+s;)if(r[s]===t[o+s]){if(s===n-1)return o;++s}else a[s]>=0?(s=a[s],o=o+s-a[s]):(s=0,++o);return e},i=function(t){var r=t.length,e=[],i=2,n=0;for(e[0]=-1,e[1]=0;r>i;)t[i-1]===t[n]?(++n,e[i]=n,++i):n>0?n=e[n]:(e[i]=0,++i);return e};r.exports=e},{}],44:[function(t,r){"use strict";var e=function(t,r){var e,i,n=[];for(e=0;e<=t.length;e++)n[e]=[],n[e][0]=e;for(i=0;i<=r.length;i++)n[0][i]=i;for(e=1;e<=t.length;e++)for(i=1;i<=r.length;i++)n[e][i]=Math.min(n[e-1][i-1],n[e-1][i],n[e][i-1])+(t[e-1]!==r[i-1]?1:0);return n[t.length][r.length]};r.exports=e},{}],45:[function(t,r){"use strict";var e=function(t,r){var e,i,n=new Array(t.length+1);for(e=0;e<=t.length;e++)n[e]=new Int32Array(r.length+1);for(e=1;e<=t.length;e++)for(i=1;i<=r.length;i++)n[e][i]=t[e-1]===r[i-1]?n[e-1][i-1]+1:Math.max(n[e][i-1],n[e-1][i]);e=t.length,i=r.length;for(var o="";0!==n[e][i];)t[e-1]===r[i-1]?(o=t[e-1]+o,e--,i--):n[e-1][i]>n[e][i-1]?e--:i--;return o};r.exports=e},{}],46:[function(t,r){"use strict";var e=function(t,r){var e,i,n=new Array(t.length+1);for(e=0;e<=t.length+1;e++)n[e]=new Int32Array(r.length+1);var o={},s=0;for(e=1;e<=t.length;e++)for(i=1;i<=r.length;i++)t[e-1]===r[i-1]?(n[e][i]=n[e-1][i-1]+1,n[e][i]>s&&(o.i=e,o.j=i,s=n[e][i])):n[e][i]=0;var a="";return s&&(a=t.substring(o.i-s,o.i)),a};r.exports=e},{}],47:[function(t,r){"use strict";var e=997,i=function(t,r){if(0===r.length)return 0;for(var i,o=n(r),s=t.substring(0,r.length),a=r.length;a<=t.length;a++)if(void 0===i?i=n(s):(i-=s.charCodeAt(0)*Math.pow(e,r.length-1),i*=e,i+=t.charCodeAt(a),s=s.substring(1)+t[a]),o===i&&r===s)return a===r.length?0:a-r.length+1;return-1},n=function(t){for(var r=0,i=0;ir.right.height?n=r.left:r.left.heighto.right.height)r=o.left;else if(o.left.heightt?"left":"right",r[e]?this.insert(t,r[e]):(r[e]=new i(t,null,null,r),this.keepHeightBalance(r[e],!1))},e.prototype.inOrder=function(t,r){t&&(this.inOrder(t.left,r),"function"==typeof r&&r(t),this.inOrder(t.right,r))},e.prototype.postOrder=function(t,r){t&&(this.postOrder(t.left,r),this.postOrder(t.right,r),"function"==typeof r&&r(t))},e.prototype.preOrder=function(t,r){t&&("function"==typeof r&&r(t),this.preOrder(t.left,r),this.preOrder(t.right,r))},e.prototype.find=function(t){return this._find(t,this.root)},e.prototype._find=function(t,r){if(!r)return null;var e;return r.value===t?e=r:r.value>t?e=this._find(t,r.left):r.valuet.value&&(r=t),this._findMin(t.left,r)):r},e.prototype._findMax=function(t,r){return r=r||{value:-(1/0)},t?(r.value2&&t.apply(this,[].slice.call(arguments,1)),this._introduce(r),this._introduce(e);var i=this.root(r),n=this.root(e);return this._ranks[i]0;t-=t&-t)r+=this._elements[t];return r},e.prototype.rangeSum=function(t,r){return this.prefixSum(r)-this.prefixSum(t-1)},r.exports=e},{}],53:[function(t,r){"use strict";function e(t){this.directed=void 0===t?!0:!!t,this.adjList=Object.create(null),this.vertices=new i}var i=t("./set"),n=function(t){return""+t};e.prototype.addVertex=function(t){if(t=n(t),this.vertices.contains(t))throw new Error('Vertex "'+t+'" has already been added');this.vertices.add(t),this.adjList[t]=Object.create(null)},e.prototype.addEdge=function(t,r,e){t=n(t),r=n(r),e=void 0===e?1:e,this.adjList[t]||this.addVertex(t),this.adjList[r]||this.addVertex(r),this.adjList[t][r]=(this.adjList[t][r]||0)+e,this.directed||(this.adjList[r][t]=(this.adjList[r][t]||0)+e)},e.prototype.neighbors=function(t){return Object.keys(this.adjList[n(t)])},e.prototype.edge=function(t,r){return this.adjList[n(t)][n(r)]},r.exports=e},{"./set":59}],54:[function(t,r){"use strict";function e(t){this._table=new Array(t||64),this._items=0,Object.defineProperty(this,"capacity",{get:function(){return this._table.length}}),Object.defineProperty(this,"size",{get:function(){return this._items}})}var i=t("./linked_list");e.prototype.hash=function(t){"string"!=typeof t&&(t=JSON.stringify(t));for(var r=0,e=0;e1&&(r=t>>1)&&this._comparator.greaterThan(this._elements[r],this._elements[t]);t=r)this._swap(r,t); + +},e.prototype._siftDown=function(t){var r;for(t=t||1;(r=t<<1)<=this.n&&(r+1<=this.n&&this._comparator.lessThan(this._elements[r+1],this._elements[r])&&r++,!this._comparator.lessThan(this._elements[t],this._elements[r]));t=r)this._swap(t,r)},e.prototype.heapify=function(t){t&&(this._elements=t,this._elements.unshift(null));for(var r=this.n>>1;r>0;r--)this._siftDown(r)},e.prototype.forEach=function(t){var r,e=[];for(r=0;r0;r--)t(this.extract());this._elements=e},i.prototype=new e,r.exports={MinHeap:e,MaxHeap:i}},{"../util/comparator":69}],56:[function(t,r){"use strict";function e(){this._length=0,this.head=null,this.tail=null,Object.defineProperty(this,"length",{get:function(){return this._length}.bind(this)})}function i(t){this.value=t,this.prev=null,this.next=null}e.prototype.isEmpty=function(){return 0===this.length},e.prototype.add=function(t,r){if(r>this.length||0>r)throw new Error("Index out of bounds");var e=new i(t);if(void 0!==r&&r=this.length||0>t)throw new Error("Index out of bounds");for(var r=this.head,e=1;t>=e;e++)r=r.next;return r},e.prototype.del=function(t){if(t>=this.length||0>t)throw new Error("Index out of bounds");this.delNode(this.getNode(t))},e.prototype.delNode=function(t){t===this.tail?this.tail=t.prev:t.next.prev=t.prev,t===this.head?this.head=t.next:t.prev.next=t.next,this._length--},e.prototype.forEach=function(t){for(var r=this.head;r;)t(r.value),r=r.next},r.exports=e},{}],57:[function(t,r){"use strict";function e(t){var r=this;i.call(this,function(t,e){return r.priority(t)t.value);return t.children[i]=this._insert(t.children[i],r),t.children[i].keyt.value);return this._find(t.children[e],r)},i.prototype._minimum=function(t){return null===t?1/0:Math.min(t.value,this._minimum(t.children[0]))},i.prototype._maximum=function(t){return null===t?-(1/0):Math.max(t.value,this._maximum(t.children[1]))},i.prototype._remove=function(t,r){if(null===t)return null;var e;return t.value===r?null===t.children[0]&&null===t.children[1]?null:(e=null===t.children[0]?1:0,t=t.rotate(e),t.children[1-e]=this._remove(t.children[1-e],r),t.resize()):(e=~~(r>t.value),t.children[e]=this._remove(t.children[e],r),t.resize())},i.prototype.insert=function(t){this.root=this._insert(this.root,t)},i.prototype.find=function(t){return this._find(this.root,t)},i.prototype.minimum=function(){return this._minimum(this.root)},i.prototype.maximum=function(){return this._maximum(this.root)},i.prototype.remove=function(t){this.root=this._remove(this.root,t)},i.prototype.size=function(){return this.root?this.root.size:0},i.prototype.height=function(){return this.root?this.root.height:0},r.exports=i},{}],62:[function(t,r){"use strict";r.exports={BezierCurve:t("./algorithms/geometry/bezier_curve")}},{"./algorithms/geometry/bezier_curve":1}],63:[function(t,r){"use strict";r.exports={topologicalSort:t("./algorithms/graph/topological_sort"),dijkstra:t("./algorithms/graph/dijkstra"),SPFA:t("./algorithms/graph/SPFA"),bellmanFord:t("./algorithms/graph/bellman_ford"),eulerPath:t("./algorithms/graph/euler_path"),depthFirstSearch:t("./algorithms/graph/depth_first_search"),kruskal:t("./algorithms/graph/kruskal"),breadthFirstSearch:t("./algorithms/graph/breadth_first_search"),bfsShortestPath:t("./algorithms/graph/bfs_shortest_path"),prim:t("./algorithms/graph/prim"),floydWarshall:t("./algorithms/graph/floyd_warshall")}},{"./algorithms/graph/SPFA":2,"./algorithms/graph/bellman_ford":3,"./algorithms/graph/bfs_shortest_path":4,"./algorithms/graph/breadth_first_search":5,"./algorithms/graph/depth_first_search":6,"./algorithms/graph/dijkstra":7,"./algorithms/graph/euler_path":8,"./algorithms/graph/floyd_warshall":9,"./algorithms/graph/kruskal":10,"./algorithms/graph/prim":11,"./algorithms/graph/topological_sort":12}],64:[function(t,r){"use strict";var e={DataStructures:t("./data_structures"),Graph:t("./graph"),Geometry:t("./geometry"),Math:t("./math"),Search:t("./search"),Sorting:t("./sorting"),String:t("./string")};r.exports=e},{"./data_structures":48,"./geometry":62,"./graph":63,"./math":65,"./search":66,"./sorting":67,"./string":68}],65:[function(t,r){"use strict";r.exports={fibonacci:t("./algorithms/math/fibonacci"),fisherYates:t("./algorithms/math/fisher_yates"),gcd:t("./algorithms/math/gcd"),extendedEuclidean:t("./algorithms/math/extended_euclidean"),lcm:t("./algorithms/math/lcm"),newtonSqrt:t("./algorithms/math/newton_sqrt"),primalityTests:t("./algorithms/math/primality_tests"),reservoirSampling:t("./algorithms/math/reservoir_sampling"),fastPower:t("./algorithms/math/fast_power"),nextPermutation:t("./algorithms/math/next_permutation"),powerSet:t("./algorithms/math/power_set"),shannonEntropy:t("./algorithms/math/shannon_entropy"),collatzConjecture:t("./algorithms/math/collatz_conjecture"),greatestDifference:t("./algorithms/math/greatest_difference")}},{"./algorithms/math/collatz_conjecture":13,"./algorithms/math/extended_euclidean":14,"./algorithms/math/fast_power":15,"./algorithms/math/fibonacci":16,"./algorithms/math/fisher_yates":17,"./algorithms/math/gcd":18,"./algorithms/math/greatest_difference":19,"./algorithms/math/lcm":20,"./algorithms/math/newton_sqrt":21,"./algorithms/math/next_permutation":22,"./algorithms/math/power_set":23,"./algorithms/math/primality_tests":24,"./algorithms/math/reservoir_sampling":25,"./algorithms/math/shannon_entropy":26}],66:[function(t,r){"use strict";r.exports={bfs:t("./algorithms/search/bfs"),binarySearch:t("./algorithms/search/binarysearch"),ternarySearch:t("./algorithms/search/ternary_search"),dfs:t("./algorithms/search/dfs")}},{"./algorithms/search/bfs":27,"./algorithms/search/binarysearch":28,"./algorithms/search/dfs":29,"./algorithms/search/ternary_search":30}],67:[function(t,r){"use strict";r.exports={bubbleSort:t("./algorithms/sorting/bubble_sort"),shortBubbleSort:t("./algorithms/sorting/short_bubble_sort"),countingSort:t("./algorithms/sorting/counting_sort"),heapSort:t("./algorithms/sorting/heap_sort"),mergeSort:t("./algorithms/sorting/merge_sort"),quicksort:t("./algorithms/sorting/quicksort"),selectionSort:t("./algorithms/sorting/selection_sort"),radixSort:t("./algorithms/sorting/radix_sort"),insertionSort:t("./algorithms/sorting/insertion_sort"),shellSort:t("./algorithms/sorting/shell_sort")}},{"./algorithms/sorting/bubble_sort":31,"./algorithms/sorting/counting_sort":32,"./algorithms/sorting/heap_sort":33,"./algorithms/sorting/insertion_sort":34,"./algorithms/sorting/merge_sort":35,"./algorithms/sorting/quicksort":36,"./algorithms/sorting/radix_sort":37,"./algorithms/sorting/selection_sort":38,"./algorithms/sorting/shell_sort":39,"./algorithms/sorting/short_bubble_sort":40}],68:[function(t,r){"use strict";r.exports={levenshtein:t("./algorithms/string/levenshtein"),rabinKarp:t("./algorithms/string/rabin_karp"),knuthMorrisPratt:t("./algorithms/string/knuth_morris_pratt"),huffman:t("./algorithms/string/huffman"),hamming:t("./algorithms/string/hamming"),longestCommonSubsequence:t("./algorithms/string/longest_common_subsequence"),longestCommonSubstring:t("./algorithms/string/longest_common_substring")}},{"./algorithms/string/hamming":41,"./algorithms/string/huffman":42,"./algorithms/string/knuth_morris_pratt":43,"./algorithms/string/levenshtein":44,"./algorithms/string/longest_common_subsequence":45,"./algorithms/string/longest_common_substring":46,"./algorithms/string/rabin_karp":47}],69:[function(t,r){"use strict";function e(t){t&&(this.compare=t)}e.prototype.compare=function(t,r){return t===r?0:r>t?-1:1},e.prototype.lessThan=function(t,r){return this.compare(t,r)<0},e.prototype.lessThanOrEqual=function(t,r){return this.lessThan(t,r)||this.equal(t,r)},e.prototype.greaterThan=function(t,r){return this.compare(t,r)>0},e.prototype.greaterThanOrEqual=function(t,r){return this.greaterThan(t,r)||this.equal(t,r)},e.prototype.equal=function(t,r){return 0===this.compare(t,r)},e.prototype.reverse=function(){var t=this.compare;this.compare=function(r,e){return t(e,r)}},r.exports=e},{}]},{},[64])(64)})}({},function(){return this}()); \ No newline at end of file diff --git a/package.json b/package.json index beed33b..50448ef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "algorithms", - "version": "0.9.1", + "version": "0.10.0", "description": "Traditional computer science algorithms and data structures implemented in JavaScript", "main": "./index.js", "scripts": {