mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-11-10 11:09:43 +08:00
Merge 89330bf573
into ca3d16dcce
This commit is contained in:
commit
6117583026
@ -145,7 +145,7 @@ end remove
|
|||||||
findParent(value, root)
|
findParent(value, root)
|
||||||
Pre: value is the value of the node we want to find the parent of
|
Pre: value is the value of the node we want to find the parent of
|
||||||
root is the root node of the BST and is != ø
|
root is the root node of the BST and is != ø
|
||||||
Post: a reference to the prent node of value if found; otherwise ø
|
Post: a reference to the parent node of value if found; otherwise ø
|
||||||
if value = root.value
|
if value = root.value
|
||||||
return ø
|
return ø
|
||||||
end if
|
end if
|
||||||
|
@ -143,7 +143,7 @@ end remove
|
|||||||
findParent(value, root)
|
findParent(value, root)
|
||||||
Pre: value is the value of the node we want to find the parent of
|
Pre: value is the value of the node we want to find the parent of
|
||||||
root is the root node of the BST and is != ø
|
root is the root node of the BST and is != ø
|
||||||
Post: a reference to the prent node of value if found; otherwise ø
|
Post: a reference to the parent node of value if found; otherwise ø
|
||||||
if value = root.value
|
if value = root.value
|
||||||
return ø
|
return ø
|
||||||
end if
|
end if
|
||||||
|
Loading…
Reference in New Issue
Block a user