@@ -50,61 +50,62 @@ class bst{
50
50
* 2 - methods
51
51
* ==================
52
52
* 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
56
56
*
57
57
* 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"
61
61
*
62
62
* 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"
66
66
*
67
67
* 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
71
71
*
72
72
* static methods
73
73
* =================
74
74
* 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
76
76
* 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"
79
79
*
80
80
* 2 - set() :
81
81
* changes that value associated with the given key of type T1 (1st argument) to the given value of type T2 (2nd argument)
82
82
* if key not found make it
83
83
* parameters : node <bst<T1, T2>* >, k:<T1> , v:<T2>
84
84
* return type : bst<T1, T2>*
85
- * excpetions : none
85
+ * excpetions : none
86
86
*
87
87
*
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
92
93
*
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
97
99
*
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
102
105
* possible updates
103
106
* =================
104
107
* 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"
110
111
* */
0 commit comments