Lines Matching refs:node

42  * Pointer to the root node of the tree.
60 * Inserts a node into the tree with the specified key and value if
61 * the tree does not already contain a node with the specified key. If
72 // Splay on the key to move the last node on the search path for
78 var node = new SplayTree.Node(key, value);
80 node.left = this.root_;
81 node.right = this.root_.right;
84 node.right = this.root_;
85 node.left = this.root_.left;
88 this.root_ = node;
93 * Removes a node with the specified key from the tree if the tree
94 * contains a node with this key. The removed node is returned. If the
98 * @return {SplayTree.Node} The removed node.
125 * Returns the node having the specified key or null if the tree doesn't contain
126 * a node with the specified key.
178 // Splay on the key to move the node with the given key or the last
179 // node on the search path to the top of the tree.
181 // Now the result is either the root node or the greatest node in
199 this.traverse_(function(node) { result.push([node.key, node.value]); });
209 this.traverse_(function(node) { result.push(node.value); });
215 * Perform the splay operation for the given key. Moves the node with
216 * the given key to the top of the tree. If no node has the given
217 * key, the last node on the search path is moved to the top of the
228 // Create a dummy node. The use of the dummy node is a bit
229 // counter-intuitive: The right child of the dummy node will hold
230 // the L tree of the algorithm. The left child of the dummy node
231 // will hold the R tree of the algorithm. Using a dummy node, left
295 var node = nodesToVisit.shift();
296 if (node == null) {
299 f(node);
300 nodesToVisit.push(node.left);
301 nodesToVisit.push(node.right);
307 * Constructs a Splay tree node.