Skip to content

Sockets - Sarah#14

Open
sjscotton wants to merge 3 commits intoAda-C11:masterfrom
sjscotton:master
Open

Sockets - Sarah#14
sjscotton wants to merge 3 commits intoAda-C11:masterfrom
sjscotton:master

Conversation

@sjscotton
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

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

Nice work, you have an ideal solution.

Comment thread lib/array_intersection.rb
# Returns a new array to that contains elements in the intersection of the two input arrays
# Time complexity: ?
# Space complexity: ?
# Time complexity: O(n) where n is the length of the longer array
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is actually incorrect. The time complexity would be O(n + m) where n and m are the lengths of the two arrays.

Comment thread lib/array_intersection.rb

# SORTING SOLUTION

# Returns a new array to that contains elements in the intersection of the two input arrays
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It's nice that you have the sorting solution as well. Nicely done

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