What is the difference between arraylist and linkedlist?



What is the difference between arraylist and linkedlist?..

Answer / Ramesh Rastogi

ArrayList is a resizable-array data structure that implements the List interface in Java. It maintains elements in contiguous memory locations, ensuring fast read and write operations. On the other hand, LinkedList is a doubly-linked list data structure that also implements the List interface. Its nodes are linked using pointers which makes insertion and deletion of elements faster compared to ArrayList but slower for accessing elements due to random access time complexity.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Structures Interview Questions

How do you declare An array of three char pointers

1 Answers  


What is advantage and disadvantage of linked list?

1 Answers  


What is the difference between ienumerable and list?

1 Answers  


Can you provide some implementation of a dictionary having large number of words?

1 Answers  


What does isempty() member method determines?

1 Answers  


Which sort is best for linked list?

1 Answers  


Traverse the given tree using Inorder, Preorder and Postorder traversals. Inorder : D H B E A F C I G J Preorder: A B D H E C F G I J Postorder: H D E B F I J G C A

1 Answers  


What do you mean by garbage collection?

1 Answers  


What are different techniques for making hash function?

1 Answers  


Can arraylist have null values?

1 Answers  


How to cut or remove an element from the array?

1 Answers  


Can a hashmap have duplicate keys?

1 Answers  


Categories