Published
Edited
Aug 29, 2020
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function find(root, value)
{
// root of (sub)tree is empty, nothing will be found
if(root === null)
return false;
// Check to see if value found
else if(root.value === value)
return true;
// Value not found; check left or right subtree
else if(value < root.value)
return find(root.left, value);
else
return find(root.right, value);
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more