I'm working on a piece of code and hope you guys could give some help.
In the code, I will need to maintain a large array of struct, which contains several integers and chars, for real-time processing.
Basically, every time I receive some data with a unique ID, I will need to search if the ID is present or not in my array and do corresponding data processing, and update the array by either adding new entries of the array or updating the existing entries. Every now and then, I need to update the array list and remove outdated entries.
I've been originally thinking about implementing this using struct array, which means if I remove one entry, I need to do stuff myself, such as shift all the following entries. BTW, the struct looks something like the following:
I was told a linked list or hash map might be a more straightforward solution for this, which I didn't have any experience work with in the past few years. I'd appreciate it if you guys could give some suggestions.
Thanks a lot and stay healthy,