javascript binary search tree
1.0.0
更新されたリターンを使用してアイテムを追加または削除するシンプルで純粋なJavaScript BST構造のインプメーション。
var tree = new BST ( ) ; // Initialize
tree . add ( value ) ; // Add a new node
tree . remove ( value ) ; // Remove an existing node
tree . print ( ) ; // Print the tree as a text-pyramid in console
tree . min ( ) ; // Find smallest node
tree . max ( ) ; // Find largest node
tree . find ( value ) ; // Find node with given value
tree . destroy ( ) ; // Clears the root注: tree.print()を使用している間に間隔を維持するために、2桁/文字を超える値は「Z」から「A」とラベル付けされた凡例に変換されます。ラベルとキーは別々に印刷されます。
GNU General Public License v3.0に基づいてライセンスされています。自由にコピー、使用、配布できます。