Lines Matching refs:node

24    * Pointer to the root node of the tree.
42 * Inserts a node into the tree with the specified key and value if
43 * the tree does not already contain a node with the specified key. If
54 // Splay on the key to move the last node on the search path for
60 var node = new SplayTree.Node(key, value);
62 node.left = this.root_;
63 node.right = this.root_.right;
66 node.right = this.root_;
67 node.left = this.root_.left;
70 this.root_ = node;
75 * Removes a node with the specified key from the tree if the tree
76 * contains a node with this key. The removed node is returned. If the
80 * @return {SplayTree.Node} The removed node.
107 * Returns the node having the specified key or null if the tree doesn't
108 * contain a node with the specified key.
161 // Splay on the key to move the node with the given key or the last
162 // node on the search path to the top of the tree.
164 // Now the result is either the root node or the greatest node in
183 this.traverse_(function(node) { result.push([node.key, node.value]); });
193 this.traverse_(function(node) { result.push(node.value); });
199 * Perform the splay operation for the given key. Moves the node with
200 * the given key to the top of the tree. If no node has the given
201 * key, the last node on the search path is moved to the top of the
212 // Create a dummy node. The use of the dummy node is a bit
213 // counter-intuitive: The right child of the dummy node will hold
214 // the L tree of the algorithm. The left child of the dummy node
215 // will hold the R tree of the algorithm. Using a dummy node, left
279 var node = nodesToVisit.shift();
280 if (node == null) {
283 f(node);
284 nodesToVisit.push(node.left);
285 nodesToVisit.push(node.right);
291 * Constructs a Splay tree node.