-
Notifications
You must be signed in to change notification settings - Fork 53
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
Leah - Water #48
base: master
Are you sure you want to change the base?
Leah - Water #48
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.
Nicely done Leah, you hit the learning goals here. Great work!
# Time complexity: O(n) | ||
# Space complexity: O(1) | ||
def length(array) |
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.
👍
# Time complexity: O(n) | ||
# Space complexity: O(n) | ||
def print_array(array) |
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.
👍 , this mostly makes a copy of the list instead, but you are correct in time/space complexity.
# Time complexity: O(n) | ||
# Space complexity: O(1) | ||
def search(array, length, value_to_find) |
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.
👍
# Time complexity: O(n) | ||
# Space complexity: O(1) | ||
def find_largest(array, length) |
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.
👍
# Time complexity: O(n) | ||
# Space complexity: O(1) | ||
def find_smallest(array, length) |
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.
👍
# Time complexity: O(n) | ||
# Space complexity: O(1) | ||
def reverse(array, length) |
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.
👍
raise NotImplementedError | ||
i = 0 | ||
while i < (length/2) | ||
pp i |
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.
Debugging statement not needed in the submission.
pp i |
# Time complexity: O(log n) | ||
# Space complexity: O(1) | ||
def binary_search(array, length, value_to_find) |
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.
👍
Sorry this is late -- I think I finally grasped the algorithmic efficiency after another read through, so I was just able to complete both parts now.