Skip to content

Sockets - Erica#13

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

Sockets - Erica#13
norrise120 wants to merge 3 commits intoAda-C11:masterfrom
norrise120:master

Conversation

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

This definitely works and with the space & time complexity you listed. There is a counterintuitive way to solve the problem without the sets you used, instead using the 1st row and 1st column to store the row and columns to zero out. However this is a good solution. Nice work.

# Time complexity: ?
# Space complexity: ?
# Time complexity: O(n*m), where n is the number of rows and m is the number of columns in the matrix
# Space complexity: O(n), where n is the number of elements in the matrix.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actually I'd say this is O(n) where n is the number of rows or columns in the matrix. You're not building an additional 2D array.

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