🎯 Day 90 of #100DaysOfCode Today marks another milestone in my coding journey! I explored an interesting concept in Java’s Collection Framework, focusing on one of the most common yet essential data structures -the ArrayList. 💻 Problem Statement: Write a Java program to reverse the order of elements in an ArrayList<Integer> without using Collections.reverse(). 🧩 Approach I Followed: Instead of relying on Java’s built-in methods, I implemented a manual reversal logic to deepen my understanding of indexing and data manipulation. Here’s how I approached it: ✅ Step 1: Created an ArrayList and added a few integer elements. ✅ Step 2: Found the size of the list using numbers.size(). ✅ Step 3: Created a new ArrayList called reversedList to store reversed elements. ✅ Step 4: Used a for loop to traverse the list from the last index to the first, adding each element into the new list. ✅ Step 5: Printed both the original and reversed lists for comparison. 🧠 What I Learned Today: ✨ The importance of iteration and index manipulation in lists. ✨ How reversing without helper functions improves logic-building skills. ✨ Strengthened my understanding of ArrayList methods like add(), get(), and size(). ✨ Realized that coding isn’t about shortcuts -it’s about understanding how things work behind the scenes. 🚀 Every day of this challenge pushes me to go beyond syntax -to truly think like a programmer. With each problem solved, I feel more confident in building strong programming logic and clean, efficient code. 💪 The journey continues -consistency, curiosity, and code are my best companions in this 100-day challenge! #Day90 #100DaysOfCode #JavaProgramming #CollectionsFramework #ArrayList #ProblemSolving #CodingChallenge #WomenInTech #SoftwareEngineering #LearningInPublic #CodeEveryday #DeveloperJourney #ConsistencyIsKey
Reversing ArrayList in Java without Collections.reverse()
More Relevant Posts
-
🚀 Day 89 of #100DaysOfCode Today’s coding challenge pushed me to think differently while working with Java’s Collection Framework -specifically, mastering how to handle duplicates in an ArrayList without using a HashSet. 💻 Problem Statement: Remove duplicates from an ArrayList<Integer> without using a HashSet. Hint: Use nested loops or a new list to store unique elements. 🧩 My Approach: I began by creating an ArrayList containing duplicate integer values. Instead of using a built-in Set (which automatically removes duplicates), I decided to manually filter the list using a simple logic: ✅ Create a new ArrayList to store unique elements. ✅ Traverse the original list using a loop. ✅ For each element, check if it already exists in the new list using contains(). ✅ If not present, add it. ✅ Finally, print the new list containing only unique elements. 🧠 What I Learned: ✨ How to remove duplicates manually without relying on built-in data structures. ✨ The importance of time complexity when using nested loops. ✨ Strengthened my understanding of ArrayList operations like add(), get(), and contains(). 💡 Each day of this challenge reminds me that coding is not just about syntax - it’s about problem-solving, logic, and persistence. From simple concepts to real-world logic, every step shapes me into a better developer. 🚀 Excited to keep building consistency and confidence, one line of code at a time! #Day89 #100DaysOfCode #JavaProgramming #ArrayList #CollectionsFramework #CodingChallenge #WomenInTech #SoftwareDevelopment #ProblemSolving #LearningInPublic #CodeEveryday #DeveloperJourney
To view or add a comment, sign in
-
-
🚀 #Day19 of My Coding Journey: Mastering String Handling in Java! 📢 Strings are the backbone of data in programming, and today I dove deep into String Handling in Java. It's been incredibly valuable to understand the mechanics of manipulating data, from simple text to complex messages. 📝 Here's what I learned and practiced: 🥇Comparison Methods: Explored equals(), equalsIgnoreCase(), and compareTo() to compare strings directly and by ignoring case. 🥈Case Conversion: Used toUpperCase() and toLowerCase() to standardize text formats. ♟️Length & Character Operations: Got hands-on with length() to find the size and charAt() to access specific characters. ⏳Search Operations: Practiced using indexOf() and lastIndexOf() to pinpoint the location of characters or words. 🧩Start & End Check: Learned to use startsWith() and endsWith() for specific text verification. 🎯Modification & Cleanup: Utilized replace(), trim(), split(), and concat() for cleaning, modifying, and combining strings. 📌A key takeaway was truly understanding why strings in Java are immutable—once created, their value can't be changed. This solidifies my understanding of how Java manages memory and data integrity. 🪄This is a crucial step toward building strong fundamentals and processing real-world text data efficiently! A special thanks to my mentor Anand Kumar Buddarapu and Codegnan for their continuous guidance! Saketh Kallepu &Uppugundla Sairam #Java #StringHandling #Programming #CodingJourney #Day19 #TechSkills
To view or add a comment, sign in
-
📚 Day 42 of My Java Journey: Deep Dive into ArrayList & Collections Framework Just completed an intensive session on Java Collections Framework, and the depth of knowledge shared was incredible! Here are the key takeaways from today's learning: 🔑 Core Concepts Mastered: • ArrayList Fundamentals - Learned how ArrayList is a dynamic, resizable array with initial capacity of 10, expanding by formula: (currentCapacity * 3/2) + 1 when needed • ArrayList vs Array - Key differences: ArrayList stores only objects (not primitives), supports heterogeneous data, preserves insertion order, and allows duplicates and null values • Memory Management - Understanding how resizing creates a new ArrayList and copies elements (O(n) operation) - crucial for performance optimization • Access Methods: Traditional for loop with .get(index) Enhanced for-each loop for simple iteration Iterator pattern for cursor-based traversal ListIterator for bidirectional navigation • Hierarchy Understanding - ArrayList → List → SequencedCollection → Collection → Iterable (knowing this chain is essential for interviews!) 💡 Key Insight: The most impactful learning was understanding why ArrayList resizing is costly (O(n) complexity) and how specifying initial capacity can significantly improve performance. Small optimizations, big impact! 🎯 Practical Takeaway: Collections Framework isn't just about memorizing methods - it's about understanding when to use what. ArrayList excels at rear-end insertions without resizing but struggles with frequent insertions at arbitrary positions. Special thanks to the instructor for breaking down complex concepts with real-world analogies (loved the Mandi Biryani framework explanation! 😄) Tomorrow: LinkedList deep dive! 🚀 What's your go-to collection in Java? Drop your thoughts below! 👇 #Java #JavaProgramming #CollectionsFramework #ArrayList #DataStructures #CodingLife #JavaDeveloper #Programming #TechEducation #SoftwareEngineering #BackendDevelopment #100DaysOfCode #LearnToCode #DeveloperCommunity #JavaCollections #CodingBootcamp #TechSkills #SoftwareDevelopment #ProgrammingConcepts #JavaInterview #DSA #TechLearning TAP Academy
To view or add a comment, sign in
-
-
Day 19 of my Java Learning Series 🫀 Encapsulation: The Heartbeat of Java – My OOP Journey Begins Today felt like the first beat of a powerful engine. I stepped into the world of Object-Oriented Programming (OOP), and it instantly reminded me of how the heart fuels the human body—quietly, constantly, and critically. Java’s OOP model is built on four foundational pillars: 🔹 Encapsulation 🔹 Inheritance 🔹 Polymorphism 🔹 Abstraction But today, I met the first pillar—Encapsulation—and it felt like discovering the pulse of secure software design. 🔐 What I Learned Encapsulation is all about protecting the soul of an object—its data. It’s the art of hiding internal details and exposing only what’s necessary. Like a vault that holds valuables, Java lets us: Declare data members as private Provide controlled access through public getters and setters I also learned how the this keyword acts like a compass—it helps Java distinguish between local and instance variables, avoiding confusion and ensuring clarity. 🛠️ Constructors: The Silent Architects Then came the twist—Java’s constructor, often mistaken for a method, but it’s more like a silent architect. It doesn’t return anything, yet it builds everything. It shares its name with the class and is automatically called when an object is born. This realization helped me understand the difference between a method and a constructor—not just in syntax, but in purpose. 📚 Why This Matters Encapsulation isn’t just a coding technique—it’s a mindset. It teaches us to build systems that are secure, modular, and maintainable. And today, I took my first step toward that mindset. Learning with TAP Academy has made these concepts not just understandable—but exciting. Can’t wait to explore the next pillar tomorrow! Let’s connect if you’re also on a Java journey or love diving deep into core concepts. 🚀 #Java #OOP #Encapsulation #Constructor #ObjectOrientedProgramming #CodingJourney #TapAcademy #WomenWhoCode #100DaysOfCode #JavaDeveloper #TechLearning #CodeNewbie #SoftwareEngineering #LearnInPublic
To view or add a comment, sign in
-
-
𝐄𝐩𝐢𝐬𝐨𝐝𝐞 𝟏 — 𝐎𝐎𝐏𝐒 𝐢𝐧 𝐉𝐚𝐯𝐚 : 𝐔𝐧𝐝𝐞𝐫𝐬𝐭𝐚𝐧𝐝𝐢𝐧𝐠 𝐂𝐥𝐚𝐬𝐬𝐞𝐬 & 𝐎𝐛𝐣𝐞𝐜𝐭𝐬 + 𝐀𝐫𝐫𝐚𝐲𝐬 𝐯𝐬 𝐂𝐥𝐚𝐬𝐬𝐞𝐬 Before diving into inheritance, polymorphism, or abstraction... Let’s first understand what OOPS really starts with — Classes and Objects 1️⃣𝐖𝐡𝐚𝐭 𝐢𝐬 𝐎𝐎𝐏𝐒 (Object Oriented Programming System) ➔ It’s how Java turns code into real-world logic. Instead of writing random functions, you create objects — like real-world things! 2️⃣ 𝐖𝐡𝐚𝐭 𝐢𝐬 𝐚 𝐂𝐥𝐚𝐬𝐬? ➔ A Class is like a blueprint or template. It defines what an object will contain and how it behaves. Class doesn’t exist in reality — it’s just a design. 3️⃣ 𝐖𝐡𝐚𝐭 𝐢𝐬 𝐚𝐧 𝐎𝐛𝐣𝐞𝐜𝐭? ➔ An Object is the real thing created from that blueprint. It represents something real and specific. Student → Blueprint s → Real student (Object) 4️⃣ 𝐀𝐫𝐫𝐚𝐲𝐬 𝐯𝐬 𝐂𝐥𝐚𝐬𝐬𝐞𝐬 ➔ Ever wondered — both Arrays and Classes store data... so what’s the actual difference between them? 🤔 Array(like lists) → A collection of similar type of data stored together. It can only store values. Class → A blueprint that defines how an object should look and behave. It can store data + behavior (methods) 𝐓𝐡𝐢𝐧𝐤 𝐨𝐟 𝐢𝐭 𝐥𝐢𝐤𝐞 𝐭𝐡𝐢𝐬 : 👉 Array = Cupboard with multiple boxes of the same size (like only books) 👉 Class = Blueprint to design any type of cupboard (with books, clothes, toys...) 𝐍𝐨𝐭𝐞 :- ➔ Use Arrays when you just need to store a bunch of values. ➔ Use Classes when you need to model real-world objects with properties + behaviors. 𝐈𝐦𝐩𝐨𝐫𝐭𝐚𝐧𝐭 𝐂𝐨𝐧𝐜𝐞𝐩𝐭 :- ➔ Make classes outside main() , create objects inside main(), so that main() just calls the class and doesn’t define it. ➔ In Java, when you create an object but don’t initialize its instance variables, they automatically get default values (null,0,0.0) assigned by the JVM. - Stuti Gupta #OOPsConcepts #Java #LearnJava #CodingJourney #JavaProgramming #ProgrammingBasics #TechCreators #CodeNewbie #CodingMadeEasy #WomenInTech
To view or add a comment, sign in
-
-
Today, I explored some interesting LeetCode problems to strengthen my Java and DSA fundamentals. Here’s a quick breakdown of what I solved 👇 🔹 Problem 1: Toeplitz Matrix 🧩 Question: Check whether all diagonals from top-left to bottom-right contain the same elements. 🧠 Approach: Traverse the matrix and compare each element with its bottom-right diagonal neighbor. If any mismatch occurs, return false; otherwise, true. This ensures every diagonal maintains uniformity. 📊 Complexity: Time: O(m × n) Space: O(1) 💡 Key Learning: Strengthened understanding of 2D array traversal and pattern validation. 🔹 Problem 2: Largest Number At Least Twice of Others 🧩 Question: Find the index of the largest element if it’s at least twice as large as every other element; otherwise, return -1. 🧠 Approach: Scan the array once to find the largest and second-largest elements. Check if the largest element is ≥ 2 × (second-largest). If true, return its index; else, return -1. 📊 Complexity: Time: O(n) Space: O(1) 💡 Key Learning: Practiced efficient single-pass array traversal and comparison logic. 🔹 Problem 3: Shortest Completing Word 🧩 Question: Given a license plate string and a list of words, find the shortest word that contains all the letters (and their frequencies) from the license plate. 🧠 Approach: Clean the license plate (keep only letters, make lowercase). Count frequency of each letter. For each word, check if it fulfills the required frequency. Track and return the shortest valid word. 📊 Complexity: Time: O(k × n), where k = number of words and n = average word length Space: O(1) 💡 Key Learning: Improved string manipulation, frequency mapping, and logical optimization. 🔥 Overall Takeaway: Practicing diverse problems like these boosts my problem-solving mindset, enhances Java coding efficiency, and builds confidence in tackling real-world algorithmic challenges 💪 Profile link ->https://lnkd.in/gFH_4R9a #Java #LeetCode #ProblemSolving #DSA #CodingPractice #LearningJourney #Developer #TechSkills #CodingInJava
To view or add a comment, sign in
-
#Day 2 of My #DSAChallenge•> Problem Statement:Given an integer array, move all zeroes to the right end while maintaining the relative order of non-zero elements. •> Understanding the Problem:This problem tests how efficiently we can perform in-place array manipulation without additional memory.A brute-force solution might involve creating a new array — increasing space complexity and processing overhead .•>Optimized Approach (Two-Pointer Technique):To make the solution efficient, I implemented the two-pointer approach:One pointer (j) tracks the position of the first zero.Another pointer (i) scans the array.Whenever a non-zero element is found, it’s swapped with the element at j, and j moves forward. This achieves:✅ O(N) time complexity✅ O(1) space complexity✅ Maintains element order (stable) ••> Java Implementation:int j = -1; Step 1: Find the first zero for (int i = 0; i < nums.length; i++) { if (nums[i] == 0) { j = i; break; }} Step 2: Swap non-zero elements with zero. for (int i = j + 1; i < nums.length; i++) { if (nums[i] != 0) { int temp = nums[i]; nums[i] = nums[j]; nums[j] = temp; j++; }} •> Example:Input: [0, 1, 0, 3, 12] Output: [1, 3, 12, 0, 0] •> Key Takeaway:Optimization is not just about reducing lines of code—it’s about thinking efficiently and writing with intent.Every line that saves time or space builds a sharper coding mindset.✨ Small steps each day, but consistent progress toward mastering problem-solving .#Day2 #DSAChallenge #CodingJourney #ProblemSolving #TwoPointerApproach #Java #OptimizedSolution #WomenInTech #100DaysOfCode #TechLearning #CodeBetterEveryday #DeveloperMindset #ConsistencyIsKey
To view or add a comment, sign in
-
-
💻 Mastering Java Through Practice! ☕ Over the past few days, I’ve been diving deep into Java fundamentals by solving 30+ hands-on coding problems — from string manipulation and arrays to matrix operations and logic-based challenges. Each program helped me strengthen my problem-solving mindset and understand how real-world logic translates into code. Here are some key takeaways from this practice: ✅ Understanding how loops, conditions, and string methods work behind the scenes ✅ Writing clean and reusable Java code ✅ Learning the importance of edge cases and user input handling ✅ Gaining confidence with interview-level programs like: 🔁 Reversing strings and sentences 🔢 Counting vowels, digits, and special characters 🧮 Sorting arrays and finding 2nd highest numbers 🔤 Checking anagrams and palindromes 🔄 Rotating matrices clockwise and anticlockwise ✨ Every small project like this builds the foundation for writing efficient and optimized code. 📘 Next goal: Apply these concepts to build Java-based applications (like quizzes, utilities, or small tools). 👉 If you’re also learning Java, start with these kinds of mini-programs — they’re simple but powerful in shaping your logic. #Java #Coding #Programming #DeveloperJourney #LearningByDoing #ProblemSolving #SoftwareEngineering #100DaysOfCode
To view or add a comment, sign in
-
Hello Connection ❗ learning codding string frequency #day17 Today I practiced a core Java concept: calculating character frequency using HashMap. This small program helped me revise: 🔹 Iterating through a string using toCharArray() 🔹 Using HashMap to store counts 🔹 Applying getOrDefault() for cleaner code 🔹 Looping through entrySet() to print results 💡 Key Takeaway: Even simple problems can help us strengthen fundamentals. Mastering basics like HashMap, loops, and string manipulation makes advanced topics easier. If you're preparing for coding interviews, this is a must-practice pattern! 🔥 If you want, I can also create: ✔ A more professional version ✔ A beginner-friendly explainer ✔ A short motivational caption ✔ A carousel-style content script ✔ A Linkedin-optimized hashtag set #Java #JavaProgramming #JavaDeveloper #Coding #Programming #CodeNewbie #TechLearning #SoftwareDevelopment #HashMap #DataStructures #ProblemSolving #LearningEveryday #LearnToCode #CodeJourney #DeveloperLife #TechStudent #CodingPractice #InterviewPreparation #CodingSkills #LogicBuilding #ProgrammingBasics #DSA #TechCommunity #SoftwareEngineer #ComputerScience #TechSkills
To view or add a comment, sign in
-
-
🧠 Day 13: Understanding Loops and Operators in Java Today, I took a deep dive into loops and operators — the real backbone of logical thinking in programming. When I first saw loops, they felt tricky. But once I started solving problems, I realized they’re just smart ways to repeat tasks — and operators help us make decisions inside them. 💻 Here’s what I practiced today: Sum or Product of numbers Terms of an Arithmetic Progression (AP) Reverse of a number Binary ↔ Decimal conversions Square root calculation Checking number sequence Pattern problems: ➤ Mirror number pattern ➤ Inverted number pattern ➤ Star pattern ➤ Triangle of numbers ➤ Diamond of stars ✨ Each problem taught me how to control logic flow, use nested loops effectively, and think step by step like a programmer. 🚀 Every loop I wrote made me more confident about how code really works behind the scenes. 💬 What was the first programming concept that made things finally “click” for you? #Java #Loops #Operators #CodingJourney #ProblemSolving #100DaysOfCode #LearningDSA #CodeNewbie #TechLearning #NeverStopLearning #WomenInTech #BuildInPublic #DeveloperJourney #CodingCommunity #LearnJava #ProgrammingBasics #KeepCoding #CodeNewbie #TechJourney
To view or add a comment, sign in
Explore related topics
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