Skip to content

Kirsten - #5

Open
kanderson38 wants to merge 2 commits into
Ada-C11:masterfrom
kanderson38:master
Open

Kirsten#5
kanderson38 wants to merge 2 commits into
Ada-C11:masterfrom
kanderson38:master

Conversation

@kanderson38

Copy link
Copy Markdown

No description provided.

@CheezItMan CheezItMan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, you hit all the learning goals here and even got BFS. Great work!

Take a look at my comments and let me know if you have questions.

Comment thread lib/tree.rb
return move_and_find(key, current)
end

def move_and_find(key, current)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like these two helper methods, but they look like they could use a refactor. Just a little messy, this is a minor issue.

Comment thread lib/tree.rb
if !@root
return results_array
end
queue = [@root]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIIIICE!!! 😀

Comment thread lib/tree.rb
# Time Complexity:
# Space Complexity:
# Time Complexity: O(n), where n is the number of nodes in the tree
# Space Complexity: O(k + m), where k is the number of leaves in the tree and m is the height of the tree

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you encounter each node just once, I would say this is O(n). The height doesn't really affect it.

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.

2 participants