-
Notifications
You must be signed in to change notification settings - Fork 49
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
base: master
Are you sure you want to change the base?
Leaves - Bri #36
Conversation
There was a problem hiding this 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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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]
No description provided.