5 AnswersNew Answer
When you can determine that you might need a Structure to store a few data types values only but you're not fully sure about the Size of the Structure; you will need to use the ArrayList Data Structure. ArrayList Data Structure facilitates rapid access to your values. When you are not sure about the Size of your Data Structure but have determined that you will need to perform many inserts and delete operation on your Data Structure; you will need to use the LinkedList Data Structure. LinkedList Data Structure also facilitates in between Data Addition and Deletion with ease.
ArrayList and LinkedList are two popular collection classes in Java and Major difference between ArrayList and LinkedList is on there implementation while ArrayList uses index based Array LinkedList is implemented using Doubly Linked ListData Structure
ArrayList is based on array, so when adding or smth else, you work with array. LinkedList is based on properties that have reference to next or previous element. You may read about their potential usage.
Accessing elements are faster with ArrayList, because it is index based. But accessing is difficult with LinkedList. It is slow access. This is to access any element, you need to navigate through the elements one by one. But insertion and deletion is much faster with LinkedList, because if you know the node, just change the pointers before or after nodes. Insertion and deletion is slow with ArrayList, this is because, during these operations ArrayList need to adjust the indexes according to deletion or insetion if you are performing on middle indexes. Means, an ArrayList having 10 elements, if you are inserting at index 5, then you need to shift the indexes above 5 to one more.
what is doubly linked list data structure?? can yu elaborate pls