Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first draft of working methods and time/space guesses #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RenCarothers
Copy link

No description provided.

Copy link
Collaborator

@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 nice work Ren, you hit the essential learning goals. I do think you should pay close attention on Big O especially space complexity on this Wednesday's lesson.

Comment on lines +11 to 14
# Time complexity: O(n); requires n steps or n operations where n is the length of the array
# Space complexity: O(n); requires n steps or n operations where n is the length of the array

def length(array)
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 However your space complexity is O(1) since you are not building any other data structure. Your method doesn't increase in memory usage if the input is bigger.

Comment on lines +32 to 34
# Time complexity: O(n); requires n steps or n operations where n is the length of the array
# Space complexity: O(n); requires n steps or n operations where n is the length of the array
def print_array(array)
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 However your space complexity is O(1) since you are not building any other data structure. Your method doesn't increase in memory usage if the input is bigger.

Comment on lines +53 to 55
# Time complexity: O(n); requires n steps or n operations where n is the length of the array
# Space complexity: O(n); requires n steps or n operations where n is the length of the array
def search(array, length, value_to_find)
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 However your space complexity is O(1) since you are not building any other data structure. Your method doesn't increase in memory usage if the input is bigger.

Comment on lines +81 to 83
# Time complexity: O(n); requires n steps or n operations where n is the length of the array
# Space complexity: O(n); requires n steps or n operations where n is the length of the array
def find_largest(array, length)
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 However your space complexity is O(1) since you are not building any other data structure. Your method doesn't increase in memory usage if the input is bigger.

Comment on lines +109 to 111
# Time complexity: O(n); requires n steps or n operations where n is the length of the array
# Space complexity: O(n); requires n steps or n operations where n is the length of the array
def find_smallest(array, length)
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 However your space complexity is O(1) since you are not building any other data structure. Your method doesn't increase in memory usage if the input is bigger.

Comment on lines +137 to 139
# Time complexity: O(n); requires n steps or n operations where n is the length of the array
# Space complexity: O(n); requires n steps or n operations where n is the length of the array
def reverse(array, length)
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 However your space complexity is O(1) since you are not building any other data structure. Your method doesn't increase in memory usage if the input is bigger.

Comment on lines +167 to 169
# Time complexity: O(logn)
# Space complexity: O(logn)
def binary_search(array, length, value_to_find)
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 However your space complexity is O(1) since you are not building any other data structure. Your method doesn't increase in memory usage if the input is bigger.

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