Q: What is the difference between LinkedList and ArrayList in terms of performance for get ,add , delete , insert.
Anonymous
A: In LinkedList add is O(1) Get is O(n) , unless getting from start , end then O(1). In ArrayList Get is O(1) , add can cause recopying of the array to bigger array then it will be O(n) in worst case , Conisdering this the average is O(1). Inserting / deleteing in LinkedList is in O(1) Inserting / deleteing in ArrayList , worst case 0(n) . That is why LinkedList is better in implementing a Queue.
Check out your Company Bowl for anonymous work chats.