I am making a game like Minecraft and I have already chunks, but I currently store those chunks in a two-dimensional array. So chunks that I loaded stay loaded and when I go on a border I can't generate more chunks because I use an array.
So my question is how can I store my chunks to delete them when they are too far from me and load them when I am close to them?