var BinarySearchTree = function (key) {
  'use strict';
  this._root = undefined;
  this._key = key;
};

BinarySearchTree.prototype = {
  /* 
   * Public methods
   */

  insert: function (node) {
    if (this._is_empty()) {
      this._root = node;
      return true;
    }

    var y;
    var x = this._root;

    while ( x !== undefined ) {
      y = x;
      if ( node[this._key] < y[this._key] ) {
        x = x.left;
      }
      else {
        x = x.right;
      }
    }

    node.parent = y;
    
    if ( node[this._key] < y[this._key]) {
      y.left = node;
    }
    else {
      y.right = node;
    }
  },

  delete: function (key) {

  },

  search: function (key) {

  },

  inorder_walk: function() {

  },

  preorder_walk: function() {

  },

  postorder_walk: function() {

  },

  minimum: function(tree) {

  },

  maximum: function(tree) {

  },

 /*
  * Private methods
  */

  _transplant: function (tree, u, v) {

  },

  _predecessor: function (x) {

  },

  _successor: function (x) {

  },

  _is_empty: function () {
    return this._root ? false : true;
  }

};
@@ -162,16 +162,160 @@
 %0A   */%0A%0A
+  /**%0A   * Inserts a new node into the tree%0A   * @this %7BBinarySearchTree%7D%0A   * @param %7Bobject%7D node The node to be inserted into the tree%0A   */%0A
   insert
@@ -943,69 +943,653 @@
 %0A%0A  
-minimum: function(tree) %7B%0A%0A  %7D,%0A%0A  maximum: function(tree) %7B%0A
+/**%0A   * Find the minimum of the tree rooted at the given node%0A   * @this %7BBinarySearchTree%7D%0A   * @param %7BObject%7D root The root of the tree to find the min of%0A   */%0A  minimum: function(root) %7B%0A    if ( !root ) %7B%0A      root = this._root;%0A    %7D%0A%0A    while ( root.left ) %7B%0A      root = root.left;%0A    %7D%0A%0A    return root;%0A  %7D,%0A%0A  /**%0A   * Find the maximum of the tree rooted at the given node%0A   * @this %7BBinarySearchTree%7D%0A   * @param %7BObject%7D root The root of the tree to find the max of%0A   */%0A  maximum: function(root) %7B%0A    if ( !root ) %7B%0A      root = this._root;%0A    %7D%0A%0A    while ( root.right ) %7B%0A      root = root.right;%0A    %7D%0A%0A    return root;
 %0A  %7D

Implement maximum and minimum methods