MCPcopy Index your code
hub / github.com/TheAlgorithms/JavaScript / add

Method add

Data-Structures/Tree/AVLTree.js:54–58  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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

Callers 3

bfsMethod · 0.45
dfsMethod · 0.45
AVLTree.test.jsFile · 0.45

Calls 1

insertFunction · 0.85

Tested by

no test coverage detected