Raisah#21
Open
raisahv wants to merge 2 commits into
Open
Conversation
CheezItMan
reviewed
Nov 14, 2019
CheezItMan
left a comment
There was a problem hiding this comment.
Overall nice work, you hit the learning goals here. Well done.
| # 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) |
| 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)) |
| 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 )) |
| # 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) |
| 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)) |
| 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) |
| 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)) |
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.