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

Branches - C. Gutierrez #28

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

Conversation

CEsGutierrez
Copy link

No description provided.

Copy link

@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 not bad. Check out my comments. I'm uncertain why you had the 21.times loops in your code. That puzzled me. You also had some issues with Big-O. Check out my comments and let me know if you have questions.

raise NotImplementedError
i = 0
length = 0
21.times do

Choose a reason for hiding this comment

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

You don't need this 21.times loop.

def print_array(array)
raise NotImplementedError
21.times do

Choose a reason for hiding this comment

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

Again you don't need this loop.

end

# Reverses the values in the integer array in place
# Time complexity: ?
# Space complexity: ?
# Time complexity: quadratic, the array is iterated through twice, so as it gorws, the time required to process it would grow twice as much.

Choose a reason for hiding this comment

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

Since the loops are not nested, and each loop runs n times. The time complexity is O(n)

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