redrobo replied to your post: This is what I need to have finished b...
I’m not sure what your other assignment requirements are, but I would implement the bag as an array of 26 ints representing the number of each letter you have. Then most of the functions are pretty straightforward O(1) operations.
Oh I see what your saying, so each element of the array would basically just hold the count of occurrences added to the array? I feel like that would be easier, but he even says that it needs to be of type char, so I'm assuming he wants a c-string of some sort.
What I'm think of is just creating a linked list for this, I think that would work - just have every node hold a single char, then its next ptr. Because in regards to returning the vector, can just go through the list, and push the char onto the vector. (Tbh probably what he wants, I'm just going to write this all up, and ask him in lab)
Tbh I feel like this program is going to need for me to use ASCII Value Codes, and man my old professor hated the shit out of that lmao.