Difference between Linked List/Array List. Which is better for insertion in the middle?
Anonymous
Array list is array backed vs head/tail nodes. This is the question where they told me to look up what the JDK does. I of course picked the LinkedList since the question explicitly said in the middle and how inserting into an array causes elements to be mass copied. They told me ArrayList actually did better though. I then proceeded to talk about how I was aware of the System.arrayCopy() that ArrayList used for insert but was personally unaware of whether or not that provided enough performance to beat the theoretical difference with a LinkedList. They didn't care/care to admit that I actually did know what I was talking about.
Check out your Company Bowl for anonymous work chats.