Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Zero Matrix

Write an algorithm such that if an element in an MxN matrix is 0, its entire row and column are set to 0.

Solutions:

Swift

O(n), where n is the number of elements in matrix (in place)
O(n) + O(n) extra memory

C++

O(n), where n is the number of elements in matrix

Installation

Run make to build and run C++ files and run Swift files. Or you can run .playground file.