r/learnSQL • • 1d ago

Title: Day 68-69 — Combined update: Java ArrayList and LinkedList, both with the Collections framework and built by hand

Over the last two days I covered ArrayList and LinkedList in Java, and I took a two-step approach to each:

  1. Using the Collections framework and its built-in methods

  2. Writing the same functionality myself without the framework

Doing the second step is what made the difference. Building the logic by hand showed me why the two structures behave differently, and made the usual “when to use which” explanations make sense. I made notes on both and practiced everything in VS Code.

Tomorrow I’m moving on to HashMap and HashSet.

For people who’ve learned collections: did you build the structures yourself too, or did you find it enough to learn the framework methods? And how did you decide when LinkedList is actually worth using over ArrayList?

4 Upvotes

2 comments sorted by

1

u/Available_Safe1818 1d ago

This isn't even related to SQL. What are you doing?

1

u/Least_Ad_1795 1h ago

Building both structures from scratch is a great way to understand how they work internally. I'd recommend learning time complexity alongside each operation. ArrayList is generally preferred for fast random access, while LinkedList can be useful for frequent insertions and deletions at known positions. Good progress! Keep going with HashMap and HashSet.