0% found this document useful (0 votes)
11 views4 pages

Collections Java

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as KEY, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views4 pages

Collections Java

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as KEY, PDF, TXT or read online on Scribd
You are on page 1/ 4

Java

Collections problem solving


Absolutely! I can create a ready-to-practice 10-question list for the most important “Reverse ArrayList” variations. I’ll include links where you can try them online (Java-based) on platforms
like GeeksforGeeks, LeetCode, and CodingNinjas.
10 Must-Practice Reverse ArrayList Questions
Core (Beginner)
1. Reverse entire ArrayList using built-in function
Platform: GeeksforGeeks (Java)
2. Reverse entire ArrayList manually (two-pointer swap)

Platform: LeetCode 344 – Reverse String(You can adapt it to ArrayList)


3. Reverse using recursion

Platform: GeeksforGeeks – Reverse Array Recursively


Interview Variations (Medium)
4.Reverse sublist (from index l to r)
Platform: LeetCode 186 – Reverse Linked List II (adapt indices to ArrayList)
5. Reverse in groups of size k

Platform: GeeksforGeeks – Reverse Array in Groups


6. Reverse alternate groups of size k

Platform: CodingNinjas – Reverse in Alternate K Groups


7. Rotate ArrayList left/right (special reverse trick)

Platform: GeeksforGeeks – Rotate Array


Advanced / Bonus
8. Reverse only even numbers
Platform: LeetCode Discussion – Custom Reverse (adapt code to ArrayList)
9. Reverse ArrayList of Strings (reverse words order)

Platform: LeetCode 557 – Reverse Words in a String III


10. Reverse using Stack

Platform: GeeksforGeeks – Reverse using Stack


💡 Tip: Start with Core 3 first, then Medium 4, then Bonus 3. Follow your diagram → rough paper → code → debug → rewrite method.

If you want, I can make a PDF with these 10 questions + links + difficulty + 3-day practice schedule so you can just open it and start solving systematically.
Do you want me to make that PDF?
Perfect 👍 I’ll now attach exact coding problems (mostly LeetCode + GFG) mapped to each day in your 4-week plan. These are carefully chosen — not too heavy, but enough to master Java Collections Framework + problem solving.

🏆 28-Day Java Collections Problem-Solving Plan with Exact Problems

Week 1 → ArrayList & LinkedList


📌 Goal: Build confidence with sequential collections.
Day 1: Learn ArrayList methods.
GFG – ArrayList in Java (practice basics)
Day 2: Reverse an ArrayList.
LeetCode 344 – Reverse String
Day 3: Remove duplicates.
LeetCode 26 – Remove Duplicates from Sorted Array
Day 4: Merge two lists.
LeetCode 88 – Merge Sorted Array
Day 5: LinkedList basics.
GFG – Linked List Insertion
Day 6: Reverse a LinkedList.
LeetCode 206 – Reverse Linked List
Day 7: Mixed practice.
LeetCode 141 – Linked List Cycle

Week 2 → Stack & Queue


📌 Goal: Get comfort with LIFO and FIFO usage.
Day 8: Reverse string using Stack.
LeetCode 20 – Valid Parentheses (variation)
Day 9: Balanced parentheses.
Same as above: LeetCode 20
Day 10: Postfix evaluation.
GFG – Evaluation of Postfix Expression
Day 11: Next Greater Element.
LeetCode 496 – Next Greater Element I
Day 12: Queue basics.
GFG – Queue using array
Day 13: Generate binary numbers 1–N.
GFG – Generate Binary Numbers
Day 14: First non-repeating character in stream.
GFG – First non-repeating character in a stream

Week 3 → HashSet & HashMap


📌 Goal: Train intuition for uniqueness and frequency counting.
Day 15: Distinct elements.
LeetCode 217 – Contains Duplicate
Day 16: Union & Intersection.
GFG – Union of two arrays
Day 17: First repeated character.
GFG – First Repeated Character
Day 18: Frequency of characters.
LeetCode 387 – First Unique Character in a String
Day 19: First non-repeating character.
LeetCode 387 (same, practice again in Java)
Day 20: Majority element.
LeetCode 169 – Majority Element
Day 21: Two Sum.
LeetCode 1 – Two Sum

Week 4 → PriorityQueue (Heap) + Mixed Problems


📌 Goal: Learn advanced collections & mix them.
Day 22: Kth largest.
LeetCode 215 – Kth Largest Element in an Array
Day 23: Kth smallest.
GFG – Kth smallest element

Day 24: Sort by frequency.


LeetCode 451 – Sort Characters By Frequency
Day 25: Top K frequent elements.
LeetCode 347 – Top K Frequent Elements
Day 26: Sliding Window Maximum.
LeetCode 239 – Sliding Window Maximum
Day 27: Group anagrams.
LeetCode 49 – Group Anagrams
Day 28: Mock practice (pick 5 random from above).

🚀 Daily Routine (3 hrs)


1 hr → Revise collection theory (syntax + when to use).
1.5 hrs → Solve the day’s problem(s) in Java.
0.5 hr → Write notes: Problem → Which Collection → Why chosen.

👉 After this 28-day plan, you’ll be able to look at any problem and quickly decide: “Stack needed → use push/pop”, “Frequency → HashMap”, “Order + uniqueness → LinkedHashSet”, etc.
Do you want me to also make you a ready-made Java code template (skeleton) for each collection (ArrayList, HashMap, Stack, Queue, PriorityQueue) so you can just plug in logic instead of writing boilerplate every time?
Week 3 → HashSet & HashMap
📌 Goal: Train intuition for uniqueness and frequency counting.
Day 15: Distinct elements.
LeetCode 217 – Contains Duplicate
Day 16: Union & Intersection.
GFG – Union of two arrays
Day 17: First repeated character.
GFG – First Repeated Character
Day 18: Frequency of characters.
LeetCode 387 – First Unique Character in a String
Day 19: First non-repeating character.
LeetCode 387 (same, practice again in Java)
Day 20: Majority element.
LeetCode 169 – Majority Element
Day 21: Two Sum.
LeetCode 1 – Two Sum

Week 4 → PriorityQueue (Heap) + Mixed Problems


📌 Goal: Learn advanced collections & mix them.
Day 22: Kth largest.
LeetCode 215 – Kth Largest Element in an Array
Day 23: Kth smallest.
GFG – Kth smallest element
Day 24: Sort by frequency.
LeetCode 451 – Sort Characters By Frequency
Day 25: Top K frequent elements.
LeetCode 347 – Top K Frequent Elements
Day 26: Sliding Window Maximum.
LeetCode 239 – Sliding Window Maximum
Day 27: Group anagrams.
LeetCode 49 – Group Anagrams
Day 28: Mock practice (pick 5 random from above).
🚀 Daily Routine (3 hrs)

1 hr → Revise collection theory (syntax + when to use).


1.5 hrs → Solve the day’s problem(s) in Java.

0.5 hr → Write notes: Problem → Which Collection → Why chosen.

👉 After this 28-day plan, you’ll be able to look at any problem and quickly decide: “Stack needed → use push/pop”, “Frequency → HashMap”, “Order + uniqueness → LinkedHashSet”, etc.

Do you want me to also make you a ready-made Java code template (skeleton) for each collection (ArrayList, HashMap, Stack, Queue, PriorityQueue) so you can just plug in logic instead of writing boilerplate every time?

You might also like