use a queue in C

Queue in C: Theory, Code Examples, and Real-World Applications

A queue is a linear data structure that follows the FIFO (First In, First Out) principle, meaning that the first element added to the queue will be the first one to be removed. This is analogous to a line at a checkout counter where the first person to stand in line is the first to…
Read more