Skip to content

Iris Lux - Water#34

Open
iris-lux wants to merge 3 commits into
Ada-C14:masterfrom
iris-lux:master
Open

Iris Lux - Water#34
iris-lux wants to merge 3 commits into
Ada-C14:masterfrom
iris-lux:master

Conversation

@iris-lux
Copy link
Copy Markdown

@iris-lux iris-lux commented Nov 3, 2020

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.

Nice work Iris, you hit the learning goals here. Well done. Take a look at my comments and let me know what questions you have.

Comment thread lib/recursive-methods.rb
Comment on lines +3 to 5
# Time complexity: O(n), where n is size of number
# 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
Comment on lines +15 to 18
# Time complexity: 0(n^2) where n is length od string
# Space complexity: 0(n^2) where n is length of string

def reverse(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
Comment on lines +24 to +26
# Time complexity: o(n) where n is length of string
# Space complexity: o(n)
def reverse_inplace(s, first = 0, last = s.length - 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 +33 to 35
# Time complexity: O(n) where n is size of number
# Space complexity: O(n)
def bunny(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
Comment on lines +41 to +44
# Time complexity: o(n) where n is length of string
# Space complexity: o(n)

def nested(s, first = 0, sub_length = s.length)
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 +54 to +57
# Time complexity: O(n) where n is length of array
# 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
Comment on lines +65 to +68
# Time complexity: O(n) where n is the length of string
# Space complexity: O(n) where n is the length of string
#
def is_palindrome(s, first = 0, sub_length = s.length)
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 +77 to +79
# Time complexity: O(logn) where n is the largest number
# Space complexity: O(logn)
def digit_match(n, m, count = 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
# Space complexity: ?
def is_palindrome(s)
raise NotImplementedError, "Method not implemented"
def fib(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.

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