Skip to main content
Code Review

Return to Answer

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

Figured it out. Did some more searching, and after a while came across these posts

http://stackoverflow.com/questions/597720/what-are-the-differences-between-a-multidimensional-array-and-an-array-of-arrays https://stackoverflow.com/questions/597720/what-are-the-differences-between-a-multidimensional-array-and-an-array-of-arrays

http://stackoverflow.com/questions/468832/why-are-multi-dimensional-arrays-in-net-slower-than-normal-arrays https://stackoverflow.com/questions/468832/why-are-multi-dimensional-arrays-in-net-slower-than-normal-arrays

The short answer is that flattening arrays and then calculating the index you want to access is the fastest way to go. Followed by Jagged arrays, because the Multi Dimensional arrays have a slow implementation in C#.

In terms of formatting, Jagged arrays also allow you to keep a bit more organised due to how they need to be initialized. You could do the same with a flattened array, but you would need to get creative with spacing and commenting to make sure everything is where it should be visually for easy reading.

Figured it out. Did some more searching, and after a while came across these posts

http://stackoverflow.com/questions/597720/what-are-the-differences-between-a-multidimensional-array-and-an-array-of-arrays

http://stackoverflow.com/questions/468832/why-are-multi-dimensional-arrays-in-net-slower-than-normal-arrays

The short answer is that flattening arrays and then calculating the index you want to access is the fastest way to go. Followed by Jagged arrays, because the Multi Dimensional arrays have a slow implementation in C#.

In terms of formatting, Jagged arrays also allow you to keep a bit more organised due to how they need to be initialized. You could do the same with a flattened array, but you would need to get creative with spacing and commenting to make sure everything is where it should be visually for easy reading.

Figured it out. Did some more searching, and after a while came across these posts

https://stackoverflow.com/questions/597720/what-are-the-differences-between-a-multidimensional-array-and-an-array-of-arrays

https://stackoverflow.com/questions/468832/why-are-multi-dimensional-arrays-in-net-slower-than-normal-arrays

The short answer is that flattening arrays and then calculating the index you want to access is the fastest way to go. Followed by Jagged arrays, because the Multi Dimensional arrays have a slow implementation in C#.

In terms of formatting, Jagged arrays also allow you to keep a bit more organised due to how they need to be initialized. You could do the same with a flattened array, but you would need to get creative with spacing and commenting to make sure everything is where it should be visually for easy reading.

Source Link

Figured it out. Did some more searching, and after a while came across these posts

http://stackoverflow.com/questions/597720/what-are-the-differences-between-a-multidimensional-array-and-an-array-of-arrays

http://stackoverflow.com/questions/468832/why-are-multi-dimensional-arrays-in-net-slower-than-normal-arrays

The short answer is that flattening arrays and then calculating the index you want to access is the fastest way to go. Followed by Jagged arrays, because the Multi Dimensional arrays have a slow implementation in C#.

In terms of formatting, Jagged arrays also allow you to keep a bit more organised due to how they need to be initialized. You could do the same with a flattened array, but you would need to get creative with spacing and commenting to make sure everything is where it should be visually for easy reading.

lang-cs

AltStyle によって変換されたページ (->オリジナル) /