Home | History | Annotate | Download | only in benchmarks

Lines Matching refs:this

7 //       notice, this list of conditions and the following disclaimer.
9 // copyright notice, this list of conditions and the following
14 // from this software without specific prior written permission.
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 // This benchmark is based on a JavaScript log processing module used
148 return !this.root_;
161 if (this.isEmpty()) {
162 this.root_ = new SplayTree.Node(key, value);
167 this.splay_(key);
168 if (this.root_.key == key) {
172 if (key > this.root_.key) {
173 node.left = this.root_;
174 node.right = this.root_.right;
175 this.root_.right = null;
177 node.right = this.root_;
178 node.left = this.root_.left;
179 this.root_.left = null;
181 this.root_ = node;
187 * contains a node with this key. The removed node is returned. If the
194 if (this.isEmpty()) {
197 this.splay_(key);
198 if (this.root_.key != key) {
201 var removed = this.root_;
202 if (!this.root_.left) {
203 this.root_ = this.root_.right;
205 var right = this.root_.right;
206 this.root_ = this.root_.left;
208 this.splay_(key);
211 this.root_.right = right;
225 if (this.isEmpty()) {
228 this.splay_(key);
229 return this.root_.key == key ? this.root_ : null;
237 if (this.isEmpty()) {
240 var current = opt_startNode || this.root_;
253 if (this.isEmpty()) {
258 this.splay_(key);
261 if (this.root_.key < key) {
262 return this.root_;
263 } else if (this.root_.left) {
264 return this.findMax(this.root_.left);
276 if (!this.isEmpty()) {
277 this.root_.traverse_(function(node) { result.push(node.key); });
287 * tree. This is the simplified top-down splaying algorithm from:
294 if (this.isEmpty()) {
304 var current = this.root_;
351 this.root_ = current;
362 this.key = key;
363 this.value = value;
381 * this SplayTree.Node.
387 var current = this;