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 isOperator (item) { | |
return item === '+' || item === '-' || item === '*' || item === '/' || item === '(' || item === ')'; | |
} | |
function convert (str) { | |
var output = [], | |
stack = [], | |
operator; |
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 BinarySearchTree () { | |
this._root = null; | |
} | |
BinarySearchTree.prototype = { | |
constructor: BinarySearchTree, | |
/** | |
* find the min number of the tree |