I have a situation where I have need a data structure that I can add strings to. This data structure is very large.
The specific qualities I need it have are:
- get(index)
- delete a certain number of entries that were added initially when the limit exceeds.(LIFO)
I've tried using an ArrayList but the delete operation is o(n) and for a linkedList the traverse or get() operation will be o(n).
What other options do I have?
get(index)operator, plus enqueuing/dequeuing front and rear.