This file contains hidden or 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
| 2.5.0 |
This file contains hidden or 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
| 2.5.0 |
This file contains hidden or 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
| 2.5.0 |
This file contains hidden or 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 binarySearch(search_ary, starting_index, ending_index, value){ | |
| //get the middle index of the search_ary | |
| // | |
| var remaining = ending_index - starting_index; | |
| var middle_index = starting_index + Math.ceil((remaining)/2); | |
| // if(remaining == 1 && starting_index == 0){middle_index = starting_index;} | |
| // debugger; | |
| //return if the value is found | |
| if(value === search_ary[middle_index]) return middle_index; |
This file contains hidden or 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(value, Walker){ | |
| this.root = new Node(value); | |
| this.walker = new Walker(this.root); | |
| } | |
| BinarySearchTree.prototype.insert = function(value) { | |
| var node = new Node(value); | |
| this.walker.setSubject(node); | |
| var nextNodeSetter = this.getSetter(); |
This file contains hidden or 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
| var DoublyLinkList = function(){ | |
| function init(node){ | |
| this.head = node; | |
| this.tail = node; | |
| } | |
| this.append = function(node){ | |
| if (!this.head){ | |
| return init.call(this,node); |
This file contains hidden or 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
| http://minus.com/lvmCcdppXFQie |