Skip to content

Conversation

@beauttie
Copy link

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

Overall well done Beauttie. 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 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, first = 0, last = s.length - 1)

Choose a reason for hiding this comment

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

👍

Comment on lines +36 to 38
# 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 +48 to 50
# 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.

👍 , but could you do this with O(n) space/time complexity?

Comment on lines +60 to 62
# 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.

👍 , but could you do this with O(n) space/time complexity?

Comment on lines +72 to +74
# Time complexity: O(n)
# Space complexity: O(n)
def is_palindrome(s, first = 0, last = s.length - 1)

Choose a reason for hiding this comment

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

👍 , Well done!

Comment on lines +84 to +86
# Time complexity: O(log n)
# Space complexity: O(log n)
def digit_match(n, m, num_matches = 0)

Choose a reason for hiding this comment

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

👍

Comment on lines 98 to 100
# Time complexity: O(n)
# Space complexity: O(n)
def fib(n)

Choose a reason for hiding this comment

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

👍 Nice getting it written, but the time complexity is O(2^n)!

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