1. Learn
  2. /
  3. Courses
  4. /
  5. Data Structures and Algorithms in Python

Connected

Exercise

Correcting bugs in a tree implementation

You have been given a program that is supposed to create the following binary tree:

Graphical representation of a tree.

Testing it, you realize that the program is not correct. Could you correct it so that it works correctly?

Instructions

100 XP
  • Correct the mistakes in the init() method.
  • Correct the mistake in the creation of the root_node.