Skip to content

Commit 936c1f8

Browse files
make-github-pseudonymous-againAurélien Ooms
authored and
Aurélien Ooms
committed
🚚 refactor: Rename insert_case5 to insert_case4.
1 parent 9e117dd commit 936c1f8

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export {default as insert_case0} from './insertion/insert_case0.js';
2222
export {default as insert_case1} from './insertion/insert_case1.js';
2323
export {default as insert_case2} from './insertion/insert_case2.js';
2424
export {default as insert_case3} from './insertion/insert_case3.js';
25-
export {default as insert_case5} from './insertion/insert_case5.js';
25+
export {default as insert_case4} from './insertion/insert_case4.js';
2626
export {default as rotate_left} from './rotate/rotate_left.js';
2727
export {default as rotate_right} from './rotate/rotate_right.js';
2828
export {default as search} from './search/search.js';

src/insertion/insert_case3.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import RED from '../color/RED.js';
55
import rotate_left from '../rotate/rotate_left.js';
66
import rotate_right from '../rotate/rotate_right.js';
77
import grandparent from '../family/grandparent.js';
8-
import insert_case5 from './insert_case5.js';
8+
import insert_case4 from './insert_case4.js';
99

1010
/**
1111
* Preconditions:
@@ -15,7 +15,7 @@ import insert_case5 from './insert_case5.js';
1515
* - n's parent is red.
1616
* - n's uncle is black.
1717
*
18-
* Here we fix the input subtree to pass the preconditions of {@link insert_case5}.
18+
* Here we fix the input subtree to pass the preconditions of {@link insert_case4}.
1919
*
2020
* @param {Node} n - The input node.
2121
*/
@@ -30,7 +30,7 @@ const insert_case3 = (n) => {
3030

3131
/**
3232
* If the path from g to n makes a left-right, change it to a left-left
33-
* with {@link rotate_left}. Then call {@link insert_case5} on the old
33+
* with {@link rotate_left}. Then call {@link insert_case4} on the old
3434
* parent of n.
3535
*
3636
* B B
@@ -60,7 +60,7 @@ const insert_case3 = (n) => {
6060
} else if (n === n.parent.left && n.parent === g.right) {
6161
/**
6262
* If the path from g to n makes a right-left, change it to a right-right
63-
* with {@link rotate_right}. Then call {@link insert_case5} on the old
63+
* with {@link rotate_right}. Then call {@link insert_case4} on the old
6464
* parent of n.
6565
*
6666
* B B
@@ -86,7 +86,7 @@ const insert_case3 = (n) => {
8686
// n = n.right ;
8787
}
8888

89-
insert_case5(n);
89+
insert_case4(n);
9090
};
9191

9292
export default insert_case3;

src/insertion/insert_case5.js renamed to src/insertion/insert_case4.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import grandparent from '../family/grandparent.js';
1717
*
1818
* @param {Node} n - The input node.
1919
*/
20-
const insert_case5 = (n) => {
20+
const insert_case4 = (n) => {
2121
assert(n instanceof Node);
2222
assert(n._color === RED);
2323
assert(n.left === null || n.left._color === BLACK);
@@ -67,4 +67,4 @@ const insert_case5 = (n) => {
6767
}
6868
};
6969

70-
export default insert_case5;
70+
export default insert_case4;

0 commit comments

Comments
 (0)