Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2854031

Browse files
committed
Replace let with var
1 parent03f4820 commit2854031

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

‎src/data-structures/size-balanced-tree.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
exports.Nil=Nil;
7575

7676
functionupdateChild(node,newChild){
77-
letparent=node.parent;
77+
varparent=node.parent;
7878
if(parent!==Nil){
7979
if(parent.right===node){
8080
parent.right=newChild;
@@ -172,7 +172,7 @@
172172

173173
functionmaintainSizeBalancedTree(node){
174174
while(node.parent!==Nil){
175-
letchildNode=node;
175+
varchildNode=node;
176176
node=node.parent;
177177
if(node.left==childNode){
178178
node=maintain(node,true);
@@ -236,8 +236,8 @@
236236
*@param {Object} value Value.
237237
*/
238238
exports.SBTree.prototype.push=function(value){
239-
letnode=findRightMost(this._root);
240-
letnewNode=newNode(value,node,Nil,Nil,1);
239+
varnode=findRightMost(this._root);
240+
varnewNode=newNode(value,node,Nil,Nil,1);
241241
if(node!==Nil)node.right=newNode;
242242
this._root=maintainSizeBalancedTree(newNode);
243243
returnnewNode;
@@ -251,9 +251,9 @@
251251
};
252252

253253
exports.SBTree.prototype.getIndex=function(node){
254-
letindex=node.left.size;
254+
varindex=node.left.size;
255255
while(node!=this._root){
256-
letparent=node.parent;
256+
varparent=node.parent;
257257
if(parent.right===node){
258258
index+=parent.left.size+1;
259259
}
@@ -266,8 +266,8 @@
266266
if(pos>=this._root.size){
267267
returnthis.push(value)
268268
}
269-
letnode=findNodeAtPos(this._root,pos);
270-
letnewNode
269+
varnode=findNodeAtPos(this._root,pos);
270+
varnewNode
271271
if(node.left===Nil){
272272
newNode=newNode(value,node,Nil,Nil,1);
273273
node.left=newNode;
@@ -284,8 +284,8 @@
284284
if(pos>=this._root.size){
285285
returnNil;// There is no element to remove
286286
}
287-
letnode=findNodeAtPos(this._root,pos);
288-
letmaintainNode;
287+
varnode=findNodeAtPos(this._root,pos);
288+
varmaintainNode;
289289

290290
/*
291291
Before remove:
@@ -313,7 +313,7 @@
313313
314314
*/
315315
if(node.left!==Nil){
316-
letLRM=findRightMost(node.left);
316+
varLRM=findRightMost(node.left);
317317
updateChild(node,node.left)
318318
LRM.right=node.right
319319
if(LRM.right===Nil){
@@ -323,7 +323,7 @@
323323
maintainNode=LRM.right;
324324
}
325325
}elseif(node.right!==Nil){
326-
letRLM=findLeftMost(node.right);
326+
varRLM=findLeftMost(node.right);
327327
updateChild(node,node.right)
328328
RLM.left=node.left
329329
if(RLM.left===Nil){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp