Hand Drawing 2D Arrays

Let me share my little findings.

Hand Drawing 2D Arrays

Sometimes, programmers have to draw 2D arrays by hand to discuss about an algorithm. If you cannot draw a 2D array effectively your argument will end up being tangled up. Let me share two findings of drawing 2D arrays.

Tip 1: Explicitly Define Axes

You should write axes explicitly beside the matrix. The i-axis should be vertical and the j-axis should be horizontal. If any, the first sequence should be placed along the i-axis and the second sequence should be placed along the j-axis.

An example of explicitly writing axes. Number of cells = 64.

Tip 2: Limit the Size

You should limit the size of the 2D array to draw. My recommendation is up to 25 cells. There should be at most several cases to consider, so why not making it concise? Keep in mind that the size of a 2D array grows very fast, and you will lose focus in a discussion if the matrix is too big.

An example of small 2D array. Number of cells = 25.