Skip to content

Raisah#21

Open
raisahv wants to merge 2 commits into
Ada-C12:masterfrom
raisahv:master
Open

Raisah#21
raisahv wants to merge 2 commits into
Ada-C12:masterfrom
raisahv:master

Conversation

@raisahv

@raisahv raisahv commented Nov 12, 2019

Copy link
Copy Markdown

No description provided.

@CheezItMan CheezItMan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Overall nice work, you hit the learning goals here. Well done.

Comment thread lib/recursive-methods.rb
# Space complexity: ?
# Time complexity: O(n) because the function will be called n times.
# Space complexity: O(n) because there will be n number of function calls placed on the system call stack.
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: O(1/2n) where n is the input string because the function will be called the length of half the input string times. O(1/2n) is reduced to O(n).
# Space complexity: O(1/2n) because there will be 1/2 n number of function calls placed on the sytem call stack. O(1/2n) is reduced to O(n).
def reverse(s, low = 0 , high = (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
raise NotImplementedError, "Method not implemented"
# Time complexity: O(1/2n) where n is the input string because the function will be called the length of half the input string times. O(1/2n) is reduced to O(n).
# Space complexity: O(1/2n) because there will be 1/2 n number of function calls placed on the sytem call stack. O(1/2n) is reduced to O(n).
def reverse_inplace(s, low = 0 , high = ( 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
# Space complexity: ?
# Time complexity: O(n) because the function will be called n times.
# Space complexity: O(n) because there will be n number of function calls placed on the system call stack.
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
raise NotImplementedError, "Method not implemented"
# Time complexity: O(1/2n) where n is the input string because the function will be called the length of half the input string times. O(1/2n) is reduced to O(n).
# Space complexity: O(1/2n) because there will be 1/2 n number of function calls placed on the sytem call stack. O(1/2n) is reduced to O(n).
def nested(s, low = 0, high = (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
raise NotImplementedError, "Method not implemented"
# Time complexity: O(n) because the function will be called n times where n is the length of the array.
# Space complexity: O(n) because there will be n number of function calls placed on the system call stack.
def search(array, value, index = 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(1/2n) where n is the input string because the function will be called the length of half the input string times. O(1/2n) is reduced to O(n).
# Space complexity: O(1/2n) because there will be 1/2 n number of function calls placed on the sytem call stack. O(1/2n) is reduced to O(n).
def is_palindrome(s, low = 0, high = (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
end No newline at end of file
# Time complexity: O(log n) because the function will be called log n times where n is the number of digits in the shorter number.
# Space complexity: O(log n) because there will be log n number of function calls placed on the system call stack where n is the number of digits in the shorter number.
def digit_match(n, m, place = 10, match_counter = 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.

👍

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