![]() HashSet doesn't maintain the insertion order.HashSet allows null value and contains only unique values.Extra memory overhead is rquired to keep track of the pointer to the next element of the list.Slow iteration of elements as compared to ArrayList.Efficient Memory Utilization ,i.e no need to pre-allocate memory.Very efficient for fast removal and addition of elements.Resizing of an arraylist when it reaches it's capacity with it initial capacity which is 10 is a costlier process as the elements will be copied from old to new space with 50% more capacity.Īn implementation of Linked List in Java can be found in this article.Due to memory coherance, for larger elements a list will need significant contiguous blocks of memory.Addition or deletion of data from the middle is time consuming as data needs to be shifted to update the list.Provides an optional option to define the size during it's creation.Fast random access of elements due to memory coherance.It provides memory coherance meaning the elements are stored in a sequential memory location. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |