i have to create a queue where the dequeue operations will be random. that is , a random location will be chosen, and deleted after returning the data stored at that location.
i was going through the two underlying datastructures that im allowed to use : linked list , and arrays. ( i cant use any prebuilt java api like the prebuilt LinkedList or ArrayList classes for the task, and have to create the data structure on my own. )
my question is, which datastructure implementation would be the overall faster process? linked lists are faster in adding and deleting elements, also doesn't need resizing, but arrays are faster at random accessing. I wanted to go with linked list as i feel it will be easier to code, but im reading in a lot of places over the web at linkedlists being old, unfashioned n stuff... and arrays are the way to go.
any suggestion , and some explanations if possible, would be great..
thanks for your help. :)