Skip to content

Earth - Anya#32

Open
anyatokar wants to merge 1 commit intoAda-C14:masterfrom
anyatokar:master
Open

Earth - Anya#32
anyatokar wants to merge 1 commit intoAda-C14:masterfrom
anyatokar:master

Conversation

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

The methods work Anya, but you do need to look more closely at your space/time complexities.

Comment on lines +3 to 5
# Time complexity: O(n)
# Space complexity: O(n^2)
def factorial(n)

Choose a reason for hiding this comment

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

👍 But your space complexity is O(n)

Comment on lines +11 to 13
# Time complexity: O(n)
# 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.

👍 But your space/time complexity is O(n^2)

Comment on lines +20 to 22
# Time complexity: O(n)
# Space complexity: O(n^2)
def reverse_inplace(s)

Choose a reason for hiding this comment

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

⚠️ This is not in place as with each iteration you're creating a new string.

Consider adjusting the header to be like this.

def reverse_inplace(s, low=0, high=s.length - 1)

Comment on lines +28 to 30
# 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 +35 to 37
# Time complexity: O(n)
# 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 the space/time complexity are both O(n^2)

Comment on lines +43 to 45
# Time complexity: O(n)
# 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 the space/time complexity are both O(n^2)

Comment on lines +51 to 53
# Time complexity: O(n)
# 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 the space/time complexity are both O(n^2)

Comment on lines +59 to +61
# Time complexity: O(n)
# Space complexity: O(n^2)
def helper_digit_match(n_string, m_string, matches)

Choose a reason for hiding this comment

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

👍 However the space/time complexity are both O(n^2)

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