File tree 1 file changed +9
-9
lines changed
src/main/java/com/thealgorithms/datastructures/trees 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -32,20 +32,20 @@ static class TreapNode {
32
32
private int priority , size ;
33
33
public TreapNode left , right ;
34
34
35
- public TreapNode (int value , int priority ) {
36
- this . value = value ;
37
- this . priority = priority ;
38
- this . size = 1 ;
39
- this . left = this . right = null ;
35
+ public TreapNode (int _value , int _priority ) {
36
+ value = _value ;
37
+ priority = _priority ;
38
+ size = 1 ;
39
+ left = right = null ;
40
40
}
41
41
42
42
/**
43
43
* updateSize -> updates the subtree size of the current node
44
44
*/
45
45
private void updateSize () {
46
- this . size = 1 ;
47
- if (this . left != null ) this . size += this . left .size ;
48
- if (this . right != null ) this . size += this . right .size ;
46
+ size = 1 ;
47
+ if (left != null ) size += left .size ;
48
+ if (right != null ) size += right .size ;
49
49
}
50
50
}
51
51
@@ -63,7 +63,7 @@ private void updateSize() {
63
63
* Treap(int[] nodeValues) -> add the elements given in the array to the Treap
64
64
*/
65
65
public Treap () {
66
- this . root = null ;
66
+ root = null ;
67
67
}
68
68
69
69
public Treap (int [] nodeValues ) {
You can’t perform that action at this time.
0 commit comments