Skip to content

Leaves - Georgina#26

Open
geomsb wants to merge 1 commit intoAda-C12:masterfrom
geomsb:master
Open

Leaves - Georgina#26
geomsb wants to merge 1 commit intoAda-C12:masterfrom
geomsb:master

Conversation

@geomsb
Copy link
Copy Markdown

@geomsb geomsb commented Nov 12, 2019

No description provided.

Copy link
Copy Markdown

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

This is great work. I had a few comments, but they are minor. You hit the learning goals here. Well done!

Comment thread lib/recursive-methods.rb
# Space complexity: ?
# Time complexity: O(n)
# Space complexity: O(n)
def factorial(n)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment thread lib/recursive-methods.rb
raise NotImplementedError, "Method not implemented"
# Time complexity: 0(n)
# Space complexity: 0(n)
def reverse(s, i = 0, j = -1, n_s = "")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment thread lib/recursive-methods.rb
raise NotImplementedError, "Method not implemented"
# Time complexity: 0(n)
# Space complexity: 0(n)
def reverse_inplace(s, i = 0, j = -1)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment thread lib/recursive-methods.rb
raise NotImplementedError, "Method not implemented"
# Time complexity: O(n)
# Space complexity: O(n)
def bunny(n, i = 0, j = 0)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment thread lib/recursive-methods.rb
raise NotImplementedError, "Method not implemented"
# Time complexity: O(n)
# Space complexity: O(n)
def nested(s, i = 0, ope = 0, close = 0)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment thread lib/recursive-methods.rb
raise NotImplementedError, "Method not implemented"
# Time complexity: O(n)
# Space complexity: O(n)
def search(array, value, i = 0)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment thread lib/recursive-methods.rb
raise NotImplementedError, "Method not implemented"
# Time complexity: O(n)
# Space complexity: O(n)
def is_palindrome(s, i = 0, j = -1, coun = 1)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment thread lib/recursive-methods.rb
Comment on lines +101 to +108
if i < n.length
if n[i] == m[i]
return digit_match(n, m, i + 1, coun + 1)
else
return digit_match(n, m, i + 1, coun)
end
else
return coun
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This assumes the two numbers start with the same number of digits. Maybe this would be better, if you started at the last digit.

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