🚀 Day 21 of #100DaysOfDSA (Java) Today I explored ArrayList, an important part of the Java Collections Framework. Covered: 🔹 Difference between arrays and ArrayList 🔹 Dynamic resizing of ArrayList 🔹 Adding, removing, and updating elements 🔹 Accessing elements using index 🔹 Iterating through ArrayList 🔹 Basic operations and time complexity Key takeaway: Unlike arrays, ArrayList provides flexibility with dynamic size, making it very useful in real-world applications where data size is not fixed. Also understood how ArrayList internally works and why operations like add/remove have different time complexities. Day 21 ✅ From static arrays → to dynamic data structures. #DSA #Java #ArrayList #CollectionsFramework #100DaysOfCode #ProblemSolving #DeveloperJourney #LearningInPublic
Exploring Java ArrayList in 100 Days of DSA
More Relevant Posts
-
Day 66 — LeetCode Progress (Java) Problem: Find the Difference of Two Arrays Required: Given two integer arrays, return: Elements present in nums1 but not in nums2 Elements present in nums2 but not in nums1 Idea: Use sets to remove duplicates and quickly check membership. Approach: Convert both arrays into sets Iterate over nums1 set: Add elements not present in nums2 set to result1 Iterate over nums2 set: Add elements not present in nums1 set to result2 Return both lists Time Complexity: O(n + m) Space Complexity: O(n + m) #LeetCode #DSA #Java #HashSet #Arrays #ProblemSolving #CodingJourney
To view or add a comment, sign in
-
-
🚀 Day 35/50 – #50DaysOfCode Today, I learned about array concatenation, array slicing, and multidimensional arrays in Java, along with how to iterate over multidimensional arrays. These concepts help in handling complex data structures more efficiently. ☕💻 #Day35 #JavaFullStack #Java #CCBP #NxtWave #LearningJourney #Consistency
To view or add a comment, sign in
-
🚀 Day 38 of #100DaysOfDSA (Java) Today was focused on practice and strengthening Trie concepts. I attended a live session with my mentor where I: 🔹 Solved assignment questions on Tries 🔹 Practiced insert, search, and prefix-based problems 🔹 Improved my approach to string-based problem solving Key takeaway: Working through problems with guidance helped me understand how to apply Tries effectively, especially in prefix and dictionary-related problems. Consistent practice is helping me move from understanding concepts to actually solving problems confidently. Day 38 ✅ Focused on practice, consistency, and improving problem-solving skills. #DSA #Java #Trie #DataStructures #ProblemSolving #100DaysOfCode #DeveloperJourney #LearningInPublic #Consistency
To view or add a comment, sign in
-
-
Day 60 - Remove Duplicates from Sorted List Worked on removing duplicate elements from a sorted linked list. Approach: • Traverse the list once • Compare current node with next node • Skip duplicate nodes by adjusting pointers Time Complexity: O(n) Space Complexity: O(1) #Day60 #LeetCode #Java #LinkedList #CodingPractice #DSA #TechJourney
To view or add a comment, sign in
-
-
🚀 Day 21 of #128DaysOfCode 🔍 Key Learnings: Efficient searching in O(log n) Using low & high to narrow the range Finding correct position even if target is absent 🧠 Approach: Compare mid with target → move left/right → return index or insert position Consistency is key 🔥 #DSA #Java #CodingJourney #PlacementPreparation
To view or add a comment, sign in
-
-
🚀Day 2/100 – LeetCode Journey Today’s problem: Two Sum II (Sorted Array) 💡Approach (Two Pointer Method) Since the array is sorted, I used two pointers: One at the start (i) One at the end (j) 👉Logic: If nums[i] + nums[j] == target → return answer ✅ If sum is greater → move j-- If sum is smaller → move i++ In this problem, we return 1-based index → so answer is (i + 1, j + 1) ⚡Time Complexity: O(n) → single pass using two pointers 🧠 Space Complexity: O(1) → no extra space used 🙌 Thanks to RAVI KUMAR Sir for guidance! . . #100DaysOfCode #LeetCode #DSA #Java
To view or add a comment, sign in
-
-
Traditional Loops vs Streams in Java When working with collections, developers often face this choice 👇 Traditional Loops - Imperative approach (how to do it) - Step-by-step control - More verbose and manual Streams - Declarative approach (what to do) - Functional style (filter, map, collect) - Cleaner and more expressive code Key Insight Streams shift the focus from iteration to transformation, making code easier to read and maintain. * When to use what? - Use loops when you need fine-grained control - Use streams for cleaner, pipeline-based data processing There’s no one-size-fits-all — choose based on readability, performance, and use case. #Java #CleanCode #Streams #SoftwareEngineering #BackendDevelopment
To view or add a comment, sign in
-
-
🎉🎉 Day-26 of #60DaysOfDSA 🎉🎉 Problem: Longest Valid Parentheses 👉 Problem Statement: Given a string s consisting of '(' and ')', find the length of the longest valid (well-formed) parentheses substring. 👉 Optimized Approach (Stack Based): ✔️ Use a Stack to store indices ✔️ Push -1 initially (base for valid substring) ✔️ Traverse the string: If '(' → push index If ')': Pop from stack If stack becomes empty → push current index Else → calculate length = i - stack.peek() ✔️ Keep updating the maximum length 👉 Time Complexity : O(n) #geekstreak60 #dsa #java #problemsolving
To view or add a comment, sign in
-
-
Ever tried adding two numbers in Java… and it failed? 🤯 I recently hit this: existingValue + proposedValue ❌ Compilation error! Reason? They were not primitives… they were BigDecimal. Fix was simple, but important: existingValue.add(proposedValue) ✔ That’s when it clicked 👇 In financial or precision-based systems, BigDecimal is not just a choice — it’s a necessity. Also learned: Null handling + proper scaling (setScale) can save you from hidden production bugs. Small issue. Big lesson. Have you faced this before? #ProductionIssues #JavaDeveloper #Java #Debugging
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development