简体   繁体   English

生命游戏-数据结构

[英]Game of Life - data structure

what is the best data structure for implementing Game Of Life in Java? 在Java中实现“人生游戏”的最佳数据结构是什么?

My board is growing constantly and the order of the element is important. 我的董事会在不断增长,该元素的顺序很重要。

I was thinking about using Set , however the order of the elements is not promised me. 我当时正在考虑使用Set,但是没有答应我要保证元素的顺序。

I cannot use N x M array, as the matrix changes after every generation.. 我不能使用N x M数组,因为矩阵在每一代之后都会发生变化。

您可能需要研究Quadtrees

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM