Back to Freecodecamp

Step 1

curriculum/challenges/english/blocks/learn-tree-traversal-by-building-a-binary-search-tree/65c4eb814cc977c95cd7df0e.md

latest1.1 KB
Original Source

--description--

In this project, you are going to create a Binary Search Tree (BST). A BST is a data structure in which each node has at most two children, with the left child containing values less than the parent node and the right child containing values greater than the parent node, allowing for efficient searching and sorting operations.

This is what a Binary Search Tree looks like:

Begin by defining an empty TreeNode class. The TreeNode class represents a node in a binary search tree. Use the pass keyword to fill the class body and avoid an error.

--hints--

You should use the class keyword to declare an empty class named TreeNode.

js
({
  test: () => {
    assert(runPython(`
      import inspect
      inspect.isclass(TreeNode)
    `));
  }
})

--seed--

--seed-contents--

py
--fcc-editable-region--

--fcc-editable-region--