Skip to content

Conversation

@scottzec
Copy link

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.

Copy link
Collaborator

@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.

Nicely done Leah, you hit the learning goals here. Great work!

Comment on lines +9 to 11
# Time complexity: O(n)
# Space complexity: O(1)
def length(array)
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

Comment on lines +21 to 23
# Time complexity: O(n)
# Space complexity: O(n)
def print_array(array)
Copy link
Collaborator

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.

Comment on lines +42 to 44
# Time complexity: O(n)
# Space complexity: O(1)
def search(array, length, value_to_find)
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

Comment on lines +58 to 60
# Time complexity: O(n)
# Space complexity: O(1)
def find_largest(array, length)
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

Comment on lines +74 to 76
# Time complexity: O(n)
# Space complexity: O(1)
def find_smallest(array, length)
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

Comment on lines +90 to 92
# Time complexity: O(n)
# Space complexity: O(1)
def reverse(array, length)
Copy link
Collaborator

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
Copy link
Collaborator

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.

Suggested change
pp i

Comment on lines +108 to 110
# Time complexity: O(log n)
# Space complexity: O(1)
def binary_search(array, length, value_to_find)
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

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