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

Function searchAVLTree

Data-Structures/Tree/AVLTree.js:229–240  ·  view source on GitHub ↗
(root, val, tree)

Source from the content-addressed store, hash-verified

227}
228// search tree for a element
229const searchAVLTree = function (root, val, tree) {
230 if (root == null) {
231 return null
232 }
233 if (tree._comp(root._val, val) === 0) {
234 return root
235 }
236 if (tree._comp(root._val, val) < 0) {
237 return searchAVLTree(root._right, val, tree)
238 }
239 return searchAVLTree(root._left, val, tree)
240}
241
242/**
243 * A Code for Testing the AVLTree

Callers 1

findMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected