How different data structures can be used in game coding: List, Queue, and Stack
I'm sure most game creators are familiar with an array to store data, the problem with an array is once the size is set, it becomes much more difficult to manage. There are times when you want to sort, add, or remove data. The best way to do this is using different types of Data Structures. I'm going to focus on Lists, Queues, and Stacks though there are several others. *This article assumes you have a basic understanding of Generic types. Some sample code to learn and play around with. hopefully the comments are useful: using System.Collections; using System.Collections.Generic; using UnityEngine; public class DataStructuresScript : MonoBehaviour { string[] arrayString = new string[] { "Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten" }; List<string> listString = new List<string>(); Queue<string> q