Monday 25 November 2019

Top 5 differences between Arraylist and Linkedlist? Arraylist vs Linked list? When to use arraylist and linkedlist?Interview question for Automation testing/Core Java?

  • LinkedList can be iterated in reverse direction using descendingIterator() but to iterate over the ArrayList in reverse direction we need to write our own code

  • Insertions and Deletions are faster in LinkedList as compared to ArrayList because there is no need of resizing array and copying content to new array if array gets full which makes adding into ArrayList of O(n) in worst case, while adding is O(1) operation in LinkedList in Java. so if we have more add or delete operations then we should go with Linked list.
  • LinkedList has more memory overhead as each node holds both data and address of next and previous node but in ArrayList each index only holds actual object or we can say data.
  • ArrayList internally uses a dynamic array while LinkedList internally uses a doubly linked list.
  • Arraylist get method is faster than Linked list so fetching data or search operations is good in arraylist.

 

 

*************************************************

API Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Rest-API

 
Kubernetes Interview Question Set
https://automationreinvented.blogspot.com/search/label/Kubernetes

 
Docker Interview Question Set
https://automationreinvented.blogspot.com/2020/02/top-18-docker-commands-for-aytomation.html

 
Linux Interview question Set
https://automationreinvented.blogspot.com/search/label/Linux

 
Automation Testing/SDET Framework Design
https://automationreinvented.blogspot.com/search/label/FrameworkDesign


Java Related Interview Question Set

https://automationreinvented.blogspot.com/search/label/Java


GIT Interview Question Set:
https://automationreinvented.blogspot.com/search/label/GIT


Coding Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Coding%20Questions

 


No comments:

Post a Comment

All Time Popular Posts

Most Featured Post

Introduction to Web Testing with Playwright

  Introduction to Web Testing with Playwright 📌  Telegram Group:  https://t.me/+FTf_NPb--GQ2ODhl 📌  YouTube channel:  https://lnkd.in/gGUG...