@@ -16,10 +16,10 @@ public class TreapNode {
16
16
/**
17
17
* TreapNode class defines the individual nodes in the Treap
18
18
*
19
- * value -> holds the value of the node.
19
+ * value -> holds the value of the node.
20
20
* Binary Search Tree is built based on value.
21
21
*
22
- * priority -> holds the priority of the node.
22
+ * priority -> holds the priority of the node.
23
23
* Heaps are maintained based on priority.
24
24
* It is randomly assigned
25
25
*
@@ -125,7 +125,7 @@ private TreapNode[] split(TreapNode node, int key) {
125
125
126
126
/**
127
127
* insert a node into the Treap
128
- *
128
+ *
129
129
* @param value value to be inserted into the Treap
130
130
* @return root of the Treap where the value is inserted
131
131
*/
@@ -174,7 +174,7 @@ private TreapNode deleteNode(TreapNode root, int value) {
174
174
175
175
if (root != null ) root .updateSize ();
176
176
return root ;
177
- }
177
+ }
178
178
179
179
/**
180
180
* print inorder traversal of the Treap
@@ -226,7 +226,7 @@ private void printPostOrder(TreapNode root) {
226
226
227
227
/**
228
228
* Search a value in the Treap
229
- *
229
+ *
230
230
* @param value value to be searched for
231
231
* @return node containing the value
232
232
* null if not found
@@ -238,11 +238,11 @@ public TreapNode search(int value) {
238
238
private TreapNode searchVal (TreapNode root , int value ) {
239
239
if (root == null ) return null ;
240
240
241
- if (root .value == value )
241
+ if (root .value == value )
242
242
return root ;
243
- else if (root .value < value )
243
+ else if (root .value < value )
244
244
return searchVal (root .right , value );
245
- else
245
+ else
246
246
return searchVal (root .left , value );
247
247
}
248
248
0 commit comments