Skip to content

Branches - C. Gutierrez#28

Open
CEsGutierrez wants to merge 1 commit into
Ada-C12:masterfrom
CEsGutierrez:master
Open

Branches - C. Gutierrez#28
CEsGutierrez wants to merge 1 commit into
Ada-C12:masterfrom
CEsGutierrez:master

Conversation

@CEsGutierrez

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 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

Copy link
Copy Markdown

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.

# Space complexity: constant, no variables are stored in memory.
def print_array(array)
raise NotImplementedError
21.times do

Copy link
Copy Markdown

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.

# 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.

Copy link
Copy Markdown

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