March 2019
Intermediate to advanced
336 pages
9h 9m
English
A Boolean matrix is a matrix that consists of elements in the mth row and the nth column with a value of 1. A matrix can be modified to be a Boolean matrix by making the values in the mth row and the nth column equal to 1. In the following code, the Boolean matrix transformation and print methods are shown in detail. The changeMatrix method transforms the input matrix in to a Boolean matrix by changing the row and column values from 0 to 1 if the cell value is 1. The method takes the input matrix as the parameter and returns the changed matrix, as shown in the following code:
///main package has examples shown// in Go Data Structures and algorithms bookpackage main// importing fmt packageimport ( "fmt")//changeMatrix method ...
Read now
Unlock full access