Published
Edited
May 17, 2019
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
let test = new RedBlackTree();
if (test.contains('key1')) throw 'Function contains is not working.';
test.put('key1', 'val1');
if (!test.contains('key1')) throw 'Function contains is not working.';
test.put('key3', 'val3');
test.put('key2', 'val2');
test.put('key2', 'val4'); // val4 should replace val2.
//return test.keys();
return test.keys().map(key => test.get(key));
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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