JavaScript program to find distance between two nodes in BST
class Node { constructor ( ) { this . key = 0 ; this . left = null ; this . right = null ; } } function newNode ( key ) { var ptr = new Node ( ) ; ptr . key = key ; ptr . left = null ; ptr . right = null ; return ptr ; }