Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leaves - Bri #36

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Leaves - Bri #36

wants to merge 2 commits into from

Conversation

brilatimer
Copy link

No description provided.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

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

Ok you are missing reverse and binary search. However the other methods do work. You also had some issues identifying the space complexity. Take a look at my comments and let me know any questions you have.

# Time complexity: ?
# Space complexity: ?
# Time complexity: O(n)
# Space complexity: O(n)

Choose a reason for hiding this comment

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

Since you're not using more memory if n increases, this is actually O(1)

# Time complexity: ?
# Space complexity: ?
# Time complexity: O(n)
# Space complexity: O(n)

Choose a reason for hiding this comment

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

Similar issue to length

raise NotImplementedError
index = 0
while (array[index] != nil)
index += 1

Choose a reason for hiding this comment

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

You are not checking array[0] because of this

def find_largest(array, length)
raise NotImplementedError
index = 0
max = nil

Choose a reason for hiding this comment

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

Why not set max = array[0]

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