Search Interview Questions
| More than 3000 questions in repository.|
There are more than 900 unanswered questions.
Click here and help us by providing the answer.
Have a video suggestion.
Click Correct / Improve and please let us know.
|Data Structure - Interview Questions and Answers for 'Arraylist vs linkedlist' - 1 question(s) found - Order By Newest|
|Ans. Array List works on Array and when we add an element in middle of the list, Array List need to update the index of all subsequent elements. I the capacity is full, it even may need to move the whole list to a new memory location . Linked List works on Double linked list algorithm and all it has to do is to adjust the address of the previous and next elements.|
|Help us improve. Please let us know the company, where you were asked this question :|
|Like Discuss Correct / Improve  arraylist vs linkedlist  collections  list Asked in 2 Companies|
|If you are given a choice to use either ArrayList and LinkedList, Which one would you use and Why ?|
|What is the difference between ArrayList and LinkedList ?|
| Collections.sort can only be performed on ..|
d. Any Collection implementation
| Is this a valid initialization ? Explain.|
Collection<Collection> collection = new LinkedList<LinkedList>();
|In a Linked list with sorted numbers, insert a new numbers while maintaining the sort order.|
| What is the difference between List, Set and Map ?|
What are the different Java Collections Interfaces ?
|Difference between Vector and ArrayList ?|
|Overridden methods must have the same ...|
|Which of the following doesn't extend Collection interface ?|
|Will this code give error if i try to add two heterogeneous elements in the arraylist. ? and Why ?|