أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.
LinkedList is not as popular as ArrayList but still there are situation where a LinkedList is better choice than ArrayList in Java. Use LinkedList in Java if:
1) Your application can live without Random access. Because if you need nth element in LinkedList you need to first traverse up to nth element O(n) and than you get data from that node.
2) Your application is more insertion and deletion driver and you insert or remove more than retrieval. Since insertion or removal doesn't involve resizing its much faster than ArrayList.
Use LinkedList when you need fast insertion and deletion whereas which is slow in ArrayList
Use ArrayList when you need fast iteration and fast random access whereas which is slow in LinkedList
personally ; i don't care about speed, computers is fast enough nowadays ...... :)-