* For Adding Elements to AVL Tree * @param {any} _val * Since in AVL Tree an element can only occur once so * if a element exists it return false * @returns {Boolean} element added or not
(_val)
| 52 | * @returns {Boolean} element added or not |
| 53 | */ |
| 54 | add(_val) { |
| 55 | const prevSize = this.size |
| 56 | this.root = insert(this.root, _val, this) |
| 57 | return this.size !== prevSize |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * TO check is a particular element exists or not |
no test coverage detected