Skip to content

Dev06 6 tree node day4 assignment ricardo collado#21

Open
RicardoColladoRothschild wants to merge 2 commits intoorodriguez:mainfrom
RicardoColladoRothschild:Dev06-6-TreeNode-Day4-Assignment-Ricardo_Collado
Open

Dev06 6 tree node day4 assignment ricardo collado#21
RicardoColladoRothschild wants to merge 2 commits intoorodriguez:mainfrom
RicardoColladoRothschild:Dev06-6-TreeNode-Day4-Assignment-Ricardo_Collado

Conversation

@RicardoColladoRothschild

Solution:
Original Version of the Level() fucntion was on big o O(n).
We remove the while bucle, and use a constat time O(1), by having a field that every time a new TreeNode is created, it takes
parent Level() information (if not null) and inrease by 1. If not Parent exist, it start the root TreeNode with Level = 0

…tant time, due to be using a field that increase one, every time a new child is added (it increase base on father)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant