Skip to content
Discussion options

You must be logged in to vote

Great question! Here's a practical breakdown:

Where LinkedList actually wins:
Honestly, in modern Java, real-world cases where LinkedList clearly outperforms ArrayList are rare. The main scenario is when you're doing frequent insertions/deletions at the beginning or middle of a large list, and you already have a reference (iterator) at that position — like implementing a custom queue/deque where you're constantly adding/removing from both ends. That's actually why LinkedList implements Deque.

Insertion/deletion performance in practice:

Big-O says LinkedList insert/delete is O(1) vs ArrayList's O(n) — but that's only true if you already have the node reference. If you're searching for the …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by prathmesh235
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant