javascript binary search tree
1.0.0
Uma estrutura simples e pura da estrutura do JavaScript BST que usa retornos atualizados para adicionar ou remover itens.
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 Nota: Para manter o espaçamento enquanto estiver usando tree.print() , qualquer valor superior a 2 dígitos/caracteres será convertido em uma legenda rotulada como 'a' a 'z'. O rótulo e a chave seriam impressos separadamente.
Licenciado sob licença pública geral da GNU v3.0. É gratuito para copiar, usar e distribuir.