Thursday, June 7, 2018

We were discussing file system improvements and cloud operating system.we mentioned Xen and OSv. Zen is a hypervisor technology and OSv tries to reduce the software layers for a single application on a Virtual Machine
This means a general purpose operating system is no longer necessary. The runtime that the application requires is difficult to be ported to different hardware environment but manageable to be ported to hypervisors. This is what the cloud operating systems propose.
#codingexercise
Get count of square submatrix  that are all zero and size k
int GetCountSquareSubMatrixAll0Sizek (int[,] A, int rows, int cols, int k)
{
int Total = 0;
for ( int I = 0; I  < rows; i++) {
    for ( int j = 0; j < cols; j++) {
            // use this as the start of submatrix
            int count = 0;
            for ( int x = i; x < k; x++)
                for ( int y = j; y < k; y++)
                       If  ( x < rows && y < cols && A [x,y] == 0)
              count++;
            If (count == k * k) total += 1;
}
}
return total;
}

}

No comments:

Post a Comment