Friday, December 5, 2008

What is rank of an array?

What is rank of an array (.NET)?

Rank of the array is nothing but the number of dimensions of an array.

int[] Marks = new int[5];

int[,] Matrix = new int[5, 5];

Marks is a single dimensional array (Rank 1) and Matrix is two-dimensional array (Rank 2) containing (5 X 5) elements

2 comments:

  1. no that is not what rank of a matrix is.

    ReplyDelete
  2. Rank is no of dimensions in the array

    ReplyDelete