How to simulate a grid data type?

How to simulate a grid (minesweeper problem) as a data type in the best way? Is it better to use the vector as a two-dimensional entity. The reason for the vector is related to border validation capabilities. Is my assumption correct?

Thank:)

+3
source share
3 answers

Since the mesh size (I suppose!) Is fixed, the vector gives you a slight edge over the array. Therefore, I recommend going with a 2D array.

, , . 0 , . .

+3

, vest , , , STL (, ..). Boost multi_array , , . , ++, .

+1

, , , std:: map, std::. , , , . O (n), O (log n), O (mp) ( m p - ) O (1) .

0
source

Source: https://habr.com/ru/post/1782133/


All Articles