Skip to content

Commit 10f5de7

Browse files
authored
Update bst.h
1 parent 3d3771e commit 10f5de7

File tree

1 file changed

+34
-33
lines changed

1 file changed

+34
-33
lines changed

bst.h

+34-33
Original file line numberDiff line numberDiff line change
@@ -50,61 +50,62 @@ class bst{
5050
* 2 - methods
5151
* ==================
5252
* 1 - containsKey(T1): this method takes value of type T1 and returns if that value occurs in the tree as a key or not
53-
* parameters : k:<T1>
54-
* return type : bool
55-
* excpetions : none
53+
* parameters : k:<T1>
54+
* return type : bool
55+
* excpetions : none
5656
*
5757
* 2 - lookup(T1) : this method takes a key and returns the value associated with it, raising an exception if key not found
58-
* parameters : k:<T1>
59-
* return type : v:<T2>
60-
* excpetions : "key not found"
58+
* parameters : k:<T1>
59+
* return type : v:<T2>
60+
* excpetions : "key not found"
6161
*
6262
* 3 - modify(T1, T2) : changes that value associated with the given key of type T1 (1st argument) to the given value of type T2 (2nd argument)
63-
* parameters : k:<T1> , v:<T2>
64-
* return type : void
65-
* exceptions : "key not found"
63+
* parameters : k:<T1> , v:<T2>
64+
* return type : void
65+
* exceptions : "key not found"
6666
*
6767
* 4 - display() : this one displays the tree in preorder left-root-right as [[left], rootkey : "rootValue" , [right]]
68-
* parameters : none
69-
* return type : void
70-
* exceptions : none
68+
* parameters : none
69+
* return type : void
70+
* exceptions : none
7171
*
7272
* static methods
7373
* =================
7474
* 1 - insert() :
75-
* inserts a new key value pair of the given two values such that 1st parameter is key and 2nd one is value
75+
* inserts a new key value pair of the given two values such that 1st parameter is key and 2nd one is value
7676
* parameters : node:<bst<T1, T2>* > , k:<T1> , v:<T2>
77-
* return type : bst<T1, T2>*
78-
* exceptions : "key already exists"
77+
* return type : bst<T1, T2>*
78+
* exceptions : "key already exists"
7979
*
8080
* 2 - set() :
8181
* changes that value associated with the given key of type T1 (1st argument) to the given value of type T2 (2nd argument)
8282
* if key not found make it
8383
* parameters : node <bst<T1, T2>* >, k:<T1> , v:<T2>
8484
* return type : bst<T1, T2>*
85-
* excpetions : none
85+
* excpetions : none
8686
*
8787
*
88-
* 3 - rotateLeft() : does the left rotation operation on the given subtree
89-
* parameters : node:<bst<T1, T2> >
90-
* return type : bst<T1, T2>*
91-
* excpetions : none
88+
* 3 - rotateLeft() :
89+
* does the left rotation operation on the given subtree
90+
* parameters : node:<bst<T1, T2> >
91+
* return type : bst<T1, T2>*
92+
* excpetions : none
9293
*
93-
* 4 - rotateRight() : does the right rotation operation on the given subtree
94-
* parameters : node:<bst<T1, T2> >
95-
* return type : bst<T1, T2>*
96-
* excpetions : none
94+
* 4 - rotateRight() :
95+
* does the right rotation operation on the given subtree
96+
* parameters : node:<bst<T1, T2> >
97+
* return type : bst<T1, T2>*
98+
* excpetions : none
9799
*
98-
* 5 - lvl() : returns the height of the subtree given to it
99-
* parameters : node:<bst<T1, T2>* >
100-
* retunn type : int
101-
* exceptions : none
100+
* 5 - lvl() :
101+
* returns the height of the subtree given to it
102+
* parameters : node:<bst<T1, T2>* >
103+
* retunn type : int
104+
* exceptions : none
102105
* possible updates
103106
* =================
104107
* 1 - erase(T1) : erases the node with given key
105-
* parameters : k:<T1>
106-
* return type : void
107-
* exceptions : "key not found"
108-
*
109-
*
108+
* parameters : k:<T1>
109+
* return type : void
110+
* exceptions : "key not found"
110111
* */

0 commit comments

Comments
 (0)