Skip to content

Conversation

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

Well this is partially completed and what you have is pretty good. Take a look at my comments and let me know what questions you have.

Comment on lines +3 to 5
# Time complexity: O(n)
# Space complexity: O(n)
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 18
# 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 +50 to +52
# Time complexity: O(n)
# Space complexity: O(n)
def reverse_in_place(s)

Choose a reason for hiding this comment

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

👍

Comment on lines 56 to 58
# Time complexity: ?
# Space complexity: ?
def bunny(n)

Choose a reason for hiding this comment

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

👍 This works, but what time/space complexity do you think you have? You're dividing by 2 each time...

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.

Thanks for the updates

Comment on lines +56 to 58
# 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.

👍

# ...("a", 0) s.length = 1, idx = 0
# ...("raeb", 2) s.length = 4, idx = 2
# ...("butter", 0) => ("rutteb", 1) => ("rettub", 2) ("rettub", 3) => return
def reverse_in_place_helper(s, index)

Choose a reason for hiding this comment

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

👍 Nice

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