🚀 Day 12 – Understanding Arrays & Implementing Searching Techniques in Java Today’s focus was on mastering Arrays and implementing searching problems using methods in Core Java.this session helped me understand how data is stored, accessed, and processed efficiently using array structures — one of the most fundamental concepts in programming. Instead of writing everything inside main(), I practiced solving problems using properly defined methods to keep the logic clean and reusable. 🧩 What I Worked On: • Creating and initializing arrays • Taking array input from users • Traversing arrays using loops 🛠 Concepts Applied: ✔ Arrays (Declaration, Initialization, Traversal) ✔ Method Creation & Reusability ✔ Parameter Passing (Array as Argument) ✔ Return Statements ✔ Looping Constructs Key Learning Outcomes: • Understood how arrays manage multiple data values efficiently • Learned how to pass arrays to methods • Strengthened searching logic using structured programming • Improved code readability with modular design • Practiced writing clean, maintainable programs Arrays are a foundational step toward mastering Data Structures and Algorithms, and today strengthened that base significantly. Step by step building strong Core Java fundamentals before moving into advanced data structures and backend development #100DaysOfCode #Java #CoreJava #Arrays #DataStructures #ProblemSolving #JavaDeveloper #BackendDevelopment #CodingJourney
Mastering Arrays in Java with Searching Techniques
More Relevant Posts
-
Deep Dive into Java Fundamentals: Collections & Wrapper Classes ☕️ Today was all about strengthening the bedrock of my Java knowledge. I spent the day exploring the theoretical foundations of the Collection Interface, the Collections Utility Class, and Wrapper Classes. Understanding the "why" behind these concepts is just as important as the "how." Here’s a quick breakdown of my key takeaways: Collection vs. Collections: Clarified the distinction between the root interface for data structures and the utility class used for polymorphic algorithms (sorting, searching, etc.). Wrapper Classes: Diving into how Java wraps primitive data types into objects, enabling them to be used within the Collections Framework through Autoboxing and Unboxing. Data Structure Architecture: Looking at how different implementations (List, Set, Queue) handle data differently under the hood. Building a solid theoretical base is essential for writing efficient, scalable code. Back to the IDE to put these theories into practice! #Java #SoftwareDevelopment #JavaFullStack #CodingJourney #BackendDevelopment #ContinuousLearning
To view or add a comment, sign in
-
-
I just completed an intensive session focused on the core of Java's efficiency: Immutable Strings and Memory Management. While we often use strings daily, understanding what happens under the hood is what separates a coder from a developer. Key Takeaways from the session: The Power of Command Line Arguments: We explored how the String[] args in the main method actually functions, learning how to pass dynamic data into applications via the CLI—a crucial skill for building professional-grade tools . Strings as Objects: In Java, strings aren't just data; they are objects . I learned the three distinct ways to initialize them: using the new keyword, using string literals, and converting character arrays . Memory Architecture (SCP vs. Heap): This was a game-changer. I now understand that Java optimizes memory by using the String Constant Pool (SCP) for literals to prevent duplicates, while the Heap Area allows for duplicate objects when the new keyword is used . The Comparison Trap: I finally mastered the difference between reference comparison and value comparison. Using == compares the memory address (reference), while the .equals() method compares the actual content . Immutability: We began exploring why certain data, like birthdays or names, are best handled as immutable strings—meaning they cannot be changed once created in memory . I'm looking forward to the next phase of this journey: Object-Oriented Programming (OOP)! . #Java #SoftwareDevelopment #Programming #MemoryManagement #TechLearning #JavaDeveloper #CodingJourney #Tapacadmey
To view or add a comment, sign in
-
-
From implementing basic arrays to building my own Generic ArrayList from scratch in Java 🚀 Recently, in an interview, I was asked to implement an ArrayList with major operations. Instead of stopping there, I took it as a challenge and went deeper. Here’s what I built: ✔ Dynamic resizing (handled capacity growth) ✔ Generic support using <T> ✔ add(element) and add(index, element) ✔ remove(index) with shifting ✔ get(index) with boundary checks ✔ size() and capacity() methods ✔ Custom toString() for clean output Along the way, I also understood an important concept: 👉 Why Java doesn’t allow new T[] (due to type erasure) 👉 How real ArrayList internally uses Object[] This wasn’t just about coding — it was about understanding how data structures actually work internally. Small improvements daily → big progress over time. #Java #DataStructures #DSA #CodingInterview #Learning #Consistency
To view or add a comment, sign in
-
-
🚀 Daily DSA Practice | Java | Problem Solving Today I worked on the problem “Product of Array Except Self.” 🔍 Problem Insight The challenge is to compute the product of all elements except the current index without using division and in linear time complexity. 💡 Key Idea Instead of recomputing products repeatedly, I used the Prefix and Suffix Product technique: • First pass → store product of elements to the left • Second pass → multiply with product of elements to the right This approach avoids division and keeps the solution efficient. ⚙ Implementation ✔ Language: Java ✔ Time Complexity: O(n) ✔ Space Complexity: O(1) (excluding output array) 📈 What I Learned • How prefix/suffix techniques optimize array problems • Writing cleaner and more efficient Java code • Thinking in terms of time and space optimization Consistency matters — currently improving my Data Structures & Algorithms skills through daily problem solving. 📌 Code implementation attached from LeetCode #Java #DSA #LeetCode #SoftwareEngineering #ProblemSolving #CodingPractice #JavaDeveloper #Algorithms
To view or add a comment, sign in
-
-
🔥 DAY 55/150 — LINKED LIST REORDERING WITH POINTERS! 🔥 Day 55 of my 150 Days DSA Challenge in Java and today I solved another interesting Linked List problem that focuses on rearranging nodes efficiently without using extra space 💻🧠 📌 Problem Solved: Odd Even Linked List 📌 LeetCode: #328 📌 Difficulty: Medium The task is to rearrange a linked list such that all nodes at odd indices appear first, followed by nodes at even indices, while maintaining their original relative order. Approach Used • Maintained two pointers: Odd pointer for nodes at odd positions Even pointer for nodes at even positions • Traversed the list and updated pointers to group odd and even nodes separately • Finally connected the end of the odd list to the head of the even list. This allows the rearrangement to happen in-place without extra memory. Complexity Time Complexity: O(n) Space Complexity: O(1) Key Learnings • Linked List problems often focus on pointer manipulation instead of complex logic • Separating structures (odd and even nodes) simplifies the problem • Maintaining references carefully prevents losing parts of the list What I Learned From This Problem • Breaking the problem into smaller linked segments improves clarity • In-place modifications help achieve optimal space complexity • Visualization of node movement makes pointer problems easier to implement This problem helped strengthen my understanding of Linked List traversal and in-place restructuring 🚀 ✅ Day 55 completed 🚀 95 days to go 🔗 Java Solution on GitHub: 👉 https://lnkd.in/gZpKVJVG 💡 Linked Lists teach you how to think about data movement, not just data storage. #DSAChallenge #Java #LeetCode #LinkedList #TwoPointers #150DaysOfCode #ProblemSolving #CodingJourney #InterviewPrep #LearningInPublic
To view or add a comment, sign in
-
-
Consistency is the secret sauce for placement preparation, and today focused on diving deeper into functional logic and mathematical computing in Java. Understanding these concepts goes beyond syntax; it's about optimizing our approach to solving complex problems. Here’s a breakdown of what I tackled today: 📑 Day 02/200: Deep Dive into Java Logic 1) Functions with Parameters: Mastered how to pass data into methods to enhance code modularity and reusability. 2) Factorial Logic: Implemented both iterative and recursive approaches to calculate n!. 3) Binomial Coefficient: Applied function call nesting to solve combinations using the formula. 4) Range Analysis: Explored data limits and how to manage constraints within loops. 5) Bit Conversion: Experienced the "aha!" moment of the day—converting numbers between Binary and Decimal systems. 💡 Key Takeaway The Binomial Coefficient problem reinforced the importance of using functions. Instead of writing the factorial loop multiple times, one well-defined function handled all the work, showcasing efficiency. Current Status: 02 / 200 Days Completed ✅ #PlacementPrep #JavaProgramming #CodingJourney #100DaysOfCode #EngineeringLife #ProblemSolving #SoftwareDevelopment github: https://lnkd.in/dT9Wd8Nq
To view or add a comment, sign in
-
-
🚀 Day 15/30 – Java DSA Challenge 🔎 Problem 67: 225. Implement Stack using Queues (LeetCode – Easy) Continuing Day 15 with another foundational data structure problem — implementing a Stack (LIFO) using only Queue (FIFO) operations. This problem strengthens core understanding of: ✅ Stack vs Queue behavior ✅ Data Structure simulation ✅ Queue rotation logic ✅ LIFO implementation under constraints 🧠 Problem Summary We must design a stack using only standard queue operations: push(x) pop() top() empty() ⚠ Constraint: Only queue operations like add (push to back), poll (remove from front), peek, size, and isEmpty are allowed. 💡 Key Insight Stack → Last In First Out (LIFO) Queue → First In First Out (FIFO) To simulate LIFO behavior using FIFO: 👉 After every push, rotate the queue so the newly added element moves to the front. That ensures: pop() removes the most recently added element top() always returns the latest element 🔄 Approach Used 1️⃣ Use a single queue 2️⃣ On push(x): Add element to queue Rotate all previous elements behind it 3️⃣ pop() → simply poll from queue 4️⃣ top() → peek front 5️⃣ empty() → check if queue is empty ⏱ Complexity Analysis Push: O(N) Pop: O(1) Top: O(1) Space Complexity: O(N) 📌 Concepts Strengthened ✔ Stack fundamentals ✔ Queue manipulation ✔ Data structure transformation ✔ Logical thinking under constraints 📈 Learning Reflection Even though the problem is labeled Easy, it tests conceptual clarity. When constraints change, true understanding of data structures helps you adapt — not just memorize implementations. ✅ Day 15 Progress Update 🔥 67 Problems Solved in 30 Days DSA Challenge Consistency + Concept Clarity = Long-Term Mastery 🚀 #Day15 #30DaysOfDSA #Java #LeetCode #Stack #Queue #DataStructures #ProblemSolving #InterviewPreparation #CodingJourney
To view or add a comment, sign in
-
-
🚀 #Headline: Day 10 — How Arrays Work in Java (Deep Dive into Memory) After learning array syntax in Part 1, today's lecture went beneath the surface. This wasn't about writing more code – it was about understanding what actually happens inside the JVM when you write new int[5]. This is the kind of knowledge that separates surface-level coders from developers who truly understand their tools. Covered in this lecture: ✔️ Why arrays are stored in contiguous memory ✔️ How arrays are allocated in Heap memory (not Stack!) ✔️ Stack vs Heap – what goes where ✔️ What happens inside the JVM during array creation ✔️ How memory indexing actually works (base address + offset) ✔️ Why array access is O(1) – constant time random access ✔️ Performance implications of contiguous storage ✔️ Special case of boolean arrays ✔️ How 2D arrays are stored in memory ✔️ Array of Strings – reference behavior The "aha" moment came when the instructor explained the math behind indexing: address = base + (index × size). This is why arrays are so fast – no traversal needed, just a direct calculation. Understanding that array references live on the Stack while the actual data lives on the Heap clarifies so many concepts about memory management. This lecture truly delivered on its promise: "This is not just coding. This is internal understanding." Learning from: 👨🏫 Aditya Tandon (Instructor) 🚀 Rohit Negi (CoderArmy) 📺 Source: https://lnkd.in/gpFpcpDs Let's connect 🤝 Pankaj Kumar #Java #100DaysOfCode #ProgrammingJourney #JavaBasics #BuildInPublic
To view or add a comment, sign in
-
-
🚀 Day 15/30 – Java DSA Challenge 🔎 Problem 68: 232. Implement Queue using Stacks (LeetCode – Easy) Continuing Day 15 with another classic data structure transformation problem — implementing a Queue (FIFO) using only Stacks (LIFO) operations. This problem strengthens: ✅ Understanding of LIFO vs FIFO ✅ Stack manipulation ✅ Reversing order using auxiliary stack ✅ Core data structure fundamentals 🧠 Problem Summary We need to design a queue using only stack operations: push(x) pop() peek() empty() ⚠ Constraint: Only standard stack operations allowed — push, pop, peek, size, isEmpty. 💡 Key Insight Queue → First In First Out (FIFO) Stack → Last In First Out (LIFO) To simulate FIFO using LIFO: 👉 Use two stacks: input stack → for push operations output stack → for pop & peek operations When removing elements: If output stack is empty Transfer all elements from input stack to output stack This reverses order and maintains FIFO 🔄 Approach 1️⃣ Push → Always push into input stack 2️⃣ Pop/Peek → If output stack is empty, transfer elements Then pop/peek from output stack 3️⃣ Empty → Check both stacks ⏱ Complexity Analysis Push: O(1) Pop: Amortized O(1) Peek: Amortized O(1) Space Complexity: O(N) 📌 Concepts Reinforced ✔ Stack behavior ✔ Order reversal technique ✔ Amortized time complexity ✔ Clean data structure design 📈 Learning Reflection Even simple-tagged problems reveal deep structural concepts. Understanding how to simulate one data structure using another builds strong problem-solving foundations — crucial for interviews and system design thinking. ✅ Day 15 Progress Update 🔥 68 Problems Solved in 30 Days DSA Challenge Small daily improvements → Big long-term mastery 🚀 #Day15 #30DaysOfDSA #Java #LeetCode #Stack #Queue #DataStructures #CodingJourney #InterviewPreparation
To view or add a comment, sign in
-
-
Unpacking the Java Virtual Machine: A Deep Dive into JVM Architecture Ever wondered exactly how your Java code runs on any machine? The magic lies within the Java Virtual Machine (JVM). Understanding JVM architecture is crucial for any Java developer looking to optimize application performance, debug complex issues, and write truly robust code. This detailed diagram provides a complete breakdown of the JVM's inner workings, visualizing its three primary subsystems and how they interact: 🚀 1. Class Loader Subsystem: Responsible for dynamic class loading, linking, and initialization. It ensures only the necessary classes are loaded into memory when needed. 🧠 2. Runtime Data Areas: The JVM's memory management system. We can break this down into: Shared Areas (all threads): Method Area (storing class structures, static variables) and the Heap Area (where all object instances and arrays are allocated). Thread-Specific Areas: Each thread gets its own Stack Area, PC Register, and Native Method Stack, ensuring thread safety and efficient execution. ⚙️ 3. Execution Engine: This is where the actual computation happens. It includes: An Interpreter for quick execution of bytecode. A JIT (Just-In-Time) Compiler that optimizes frequently-used "hot" methods into native machine code for maximum performance. Garbage Collection (GC), which automatically reclaims memory by deleting objects that are no longer reachable, a core feature of Java's automatic memory management. The diagram also illustrates how the Native Method Interface (JNI) allows Java to interact with libraries written in other languages like C and C++, and how Native Method Libraries support this process. Whether you're a student just starting out or a seasoned engineer, mastering JVM internals gives you a powerful perspective on Java development. Save this diagram as a comprehensive reference guide! Let's discuss in the comments: What aspect of JVM architecture do you find most interesting or find yourself debugging most often? #Java #JVM #SoftwareEngineering #JavaDevelopment #JVMArchitecture #Programming #Coding #TechEducation #BackendDevelopment #MemoryManagement #PerformanceOptimization
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