🆕🎓 Revisit tree node's having reference to their parents #348
Labels
content --- mortar_board 🎓
Related to course content (topics, assignments, etc.)
enhancement/new 🆕
New feature, content, files, or request
Related Issues or PRs
As discussed in #347.
What
Some of the binary tree functions can be simplified, or at least cleaned up, if each node has reference to their parents.
Why
Sure, it's not needed, but it would be cool to show an alternative implementation with a quick change to the node class. Besides, not having a reference to the parent is ultimately arbitrary.
Where
Topic24? Hard to Say. It could be an aside for topic 24, or perhaps something to discuss in 2nd year. Could always have fun and have it be an exam question or something.
How
Re-implement the binary tree node with a reference for a parent node.
Additional Notes
Obviously it's not needed, but it would be a great exercise for students either way.
The text was updated successfully, but these errors were encountered: