Representing the list may or may not matter for a specific algorithm, but what does a list has to do with a stack/queue?
Not always - it depends on the implementation of the list. For example a linked list has the same overhead for inserting an element in any specified position (indeed, if the implementation only keeps a ref to the head node then you have to search sequentially to get the end … Read More
Edited by printf: typing mistake
Edited by vegaseat