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

Earth - Emily #31

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

Earth - Emily #31

wants to merge 2 commits into from

Conversation

emirry
Copy link

@emirry emirry commented Nov 3, 2020

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.

Nice work Emily, you hit the learning goals here. Well done. I do suggest you look at my suggestions and see if you can see ways to convert the methods into O(n) time/space complexity.

Comment on lines +3 to 5
# Time complexity: O(n), where n is the length
# Space complexity: O(n), uses up some space in the call stack until it reaches the base case
def factorial(n)

Choose a reason for hiding this comment

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

👍

Comment on lines +15 to 17
# Time complexity: O(n^2)
# Space complexity: O(n^2)
def reverse(s)

Choose a reason for hiding this comment

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

👍

Comment on lines +25 to 27
# Time complexity: O(n)
# Space complexity: O(n)
def reverse_inplace(s)

Choose a reason for hiding this comment

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

👍

Comment on lines +45 to 47
# Time complexity: O(n)
# Space complexity: O(n)
def bunny(n)

Choose a reason for hiding this comment

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

👍

Comment on lines +55 to 57
# Time complexity: O(n^2)
# Space complexity: O(n^2)
def nested(s)

Choose a reason for hiding this comment

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

👍 However can you see a way, like with reverse_inplace to do it with O(n) time/space complexity?

Comment on lines +70 to 72
# Time complexity: O(n^2)
# Space complexity: O(n^2)
def search(array, value)

Choose a reason for hiding this comment

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

👍 However can you see a way, like with reverse_inplace to do it with O(n) time/space complexity?

Comment on lines +82 to 84
# Time complexity: O(n^2)
# Space complexity: O(n^2)
def is_palindrome(s)

Choose a reason for hiding this comment

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

👍 However can you see a way, like with reverse_inplace to do it with O(n) time/space complexity?

Comment on lines +94 to 96
# Time complexity: O(n^2)?
# Space complexity: O(n^2)?
def digit_match(n, m)

Choose a reason for hiding this comment

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

👍 However can you see a way, like with reverse_inplace to do it with O(n) time/space complexity?

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