Skip to content

Leaves - Bri#36

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

Leaves - Bri#36
brilatimer wants to merge 2 commits into
Ada-C12:masterfrom
brilatimer:master

Conversation

@brilatimer

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.

Ok you are missing reverse and binary search. However the other methods do work. You also had some issues identifying the space complexity. Take a look at my comments and let me know any questions you have.

# Time complexity: ?
# Space complexity: ?
# Time complexity: O(n)
# Space complexity: O(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.

Since you're not using more memory if n increases, this is actually O(1)

# Time complexity: ?
# Space complexity: ?
# Time complexity: O(n)
# Space complexity: O(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.

Similar issue to length

raise NotImplementedError
index = 0
while (array[index] != nil)
index += 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.

You are not checking array[0] because of this

def find_largest(array, length)
raise NotImplementedError
index = 0
max = nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why not set max = array[0]

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