更新时间:2022-06-06 23:37:47
该算法大多是相同的。如果你有一个三维数组原始[高度,宽度,深度]
,那么你可以把它变成平[高*宽*深]
按
The algorithm is mostly the same. If you have a 3D array Original[HEIGHT, WIDTH, DEPTH]
then you could turn it into Flat[HEIGHT * WIDTH * DEPTH]
by
Flat[x + WIDTH * (y + DEPTH * z)] = Original[x, y, z]
顺便说一句,你应该$阵列在.NET中多维数组的对$ PFER阵列。的性能差异是显著
As an aside, you should prefer arrays of arrays over multi-dimensional arrays in .NET. The performance differences are significant