🚀 Day 43 / 180 – DSA with Java 🚀 📘 Topic Covered: Linked List Traversal 🧩 Problem Solved: Middle of the Linked List Problem: Given the head of a singly linked list, return the middle node. If there are two middle nodes, return the second middle node. Approach: Traversed the linked list once to count the total number of nodes. Then moved again up to the middle position and returned that node. Key Learning: ✔️ Practicing linked list traversal logic ✔️ Handling even-length edge cases correctly ✔️ Exploring multi-pass solutions before optimizing further If you’re also preparing for DSA, let’s connect and learn together 🤝 #DSA #Java #180DaysOfCode #LearningInPublic #LinkedList #ProblemSolving #Consistency
Linked List Traversal in Java: Middle Node Solution
More Relevant Posts
-
🚀 Day 38 / 180 – DSA with Java 🚀 📘 Topic Covered: Strings & Two-Pointer Technique 🧩 Problem Solved: Is Subsequence Problem: Given two strings s and t, check whether s is a subsequence of t. Approach: Used two pointers to traverse both strings. Moved the pointer in s only when characters matched, and always moved the pointer in t, ensuring order is maintained. Key Learning: ✔️ Applying two-pointer technique on strings ✔️ Understanding subsequence vs substring ✔️ Writing clean and efficient O(n) solutions If you’re also preparing for DSA, let’s connect and learn together 🤝 #DSA #Java #180DaysOfCode #LearningInPublic #Strings #ProblemSolving #Consistency
To view or add a comment, sign in
-
-
🚀 Day 42 / 180 – DSA with Java 🚀 📘 Topic Covered: Linked List Traversal 🧩 Problem Solved: Find Middle of Linked List Problem: Given the head of a linked list, find and return the middle node’s value. Approach: First traversed the linked list to calculate its length. Then traversed again up to the middle index to retrieve the middle node. Key Learning: ✔️ Understanding linked list traversal ✔️ Breaking problems into multiple passes ✔️ Thinking about optimized approaches (like slow-fast pointers) If you’re also preparing for DSA, let’s connect and learn together 🤝 #DSA #Java #180DaysOfCode #LearningInPublic #LinkedList #ProblemSolving #Consistency
To view or add a comment, sign in
-
-
🚀 Day 41 / 180 – DSA with Java 🚀 📘 Topic Covered: Matrices & Marking Technique 🧩 Problem Solved: Set Matrix Zeroes Problem: Given a matrix, if an element is 0, set its entire row and column to 0. Approach: Used two auxiliary arrays to mark rows and columns that contain zeroes. In a second pass, updated the matrix by setting elements to zero based on the marked rows and columns. Key Learning: ✔️ Handling matrix-based transformations ✔️ Using extra space for clarity and simplicity ✔️ Breaking the problem into marking and updating phases If you’re also preparing for DSA, let’s connect and learn together 🤝 #DSA #Java #180DaysOfCode #LearningInPublic #Arrays #ProblemSolving #Consistency
To view or add a comment, sign in
-
-
🚀 Java DSA Progress Update I’ve solved 125/310 problems (~40%) as part of my structured Java DSA roadmap. ✔️ Strong in: Arrays, Strings, Linked Lists, Binary Search ⚡ Focusing next on: Heap, Graphs, Dynamic Programming, Sliding Window 📌 Approach: Pattern-based problem solving Time & space analysis Learning from mistakes Re-solving for retention 🎯 Goal: Become interview-ready in 30 days with strong problem-solving fundamentals. Consistent progress > perfection. #Java #DSA #LeetCode #ProblemSolving #SoftwareEngineering
To view or add a comment, sign in
-
🚀 Day 36 / 180 – DSA with Java 🚀 📘 Topic Covered: Binary Search (Peak Finding) 🧩 Problem Solved: Find Peak Element Problem: Given an array, find a peak element (an element greater than its neighbors) and return its index. Approach: Used Binary Search by comparing the middle element with its neighbors. Based on the increasing or decreasing slope, moved towards the side where a peak must exist, reducing the search space efficiently. Key Learning: ✔️ Applying binary search on unsorted arrays using patterns ✔️ Understanding how slope direction guides decisions ✔️ Solving peak problems in O(log n) time If you’re also preparing for DSA, let’s connect and learn together 🤝 #DSA #Java #180DaysOfCode #LearningInPublic #BinarySearch #ProblemSolving #Consistency
To view or add a comment, sign in
-
-
Day 37 of My Java DSA Journey✨ Today I focused on improving my logic building skills and practiced problems using: 💡 Nested If-Else Conditions • Solved problems that required multiple condition checks • Learned how to structure logic clearly without confusion 🔄 Array Rotation • Understood how elements shift positions in an array • Practiced rotating arrays and tracking index changes 🔍 What I learned today: • Breaking complex conditions into smaller steps • Writing clean and readable logic • Importance of index handling in arrays ⚡ These problems may look simple, but they are essential for building strong problem-solving skills. 🎯 Takeaway: Strong logic + array basics = foundation for advanced DSA #Day36 #90DaysOfCoding #Java #DSA #Arrays #ProblemSolving #CodingJourney #Consistency
To view or add a comment, sign in
-
-
🚀 Day 46 / 180 – DSA with Java 🚀 📘 Topic Covered: Matrix Manipulation 🧩 Problem Solved: Rotate Image Problem: Given an n x n matrix representing an image, rotate it 90 degrees clockwise in-place. Approach: First transposed the matrix by swapping rows and columns across the diagonal. Then reversed each row to complete the 90-degree clockwise rotation efficiently without extra space. Key Learning: ✔️ Breaking matrix problems into smaller transformations ✔️ Understanding transpose operations ✔️ Solving in-place matrix rotation with O(1) extra space If you’re also preparing for DSA, let’s connect and learn together 🤝 #DSA #Java #180DaysOfCode #LearningInPublic #Matrix #ProblemSolving #Consistency 💙
To view or add a comment, sign in
-
-
🚀 Day 40 / 180 – DSA with Java 🚀 📘 Topic Covered: Binary Exponentiation (Fast Power) 🧩 Problem Solved: Pow(x, n) Problem: Implement a function to calculate x raised to the power n, handling both positive and negative values of n. Approach: Used Binary Exponentiation to reduce time complexity. Repeatedly squared the base and halved the exponent, multiplying the result only when needed. Also handled negative powers by taking the reciprocal. Key Learning: ✔️ Optimizing from O(n) to O(log n) ✔️ Understanding divide-and-conquer in exponentiation ✔️ Handling edge cases like negative powers If you’re also preparing for DSA, let’s connect and learn together 🤝 #DSA #Java #180DaysOfCode #LearningInPublic #ProblemSolving #Consistency
To view or add a comment, sign in
-
-
🚀 Another step forward in my Java + DSA journey Focused on strengthening problem-solving through creating methods/functions: • Prime number check using √n optimization and early return • Palindrome logic by reversing digits • Factorial with correct loop conditions and edge cases • Clear understanding of return vs print in methods • Writing cleaner, reusable and readable functions 💡 Key takeaway: Breaking problems into methods makes logic clearer and code reusable. Consistent learning, stronger fundamentals 🧠🔥 #Java #DSA #ProblemSolving #Functions #LearningInPublic #Consistency #CodingJourney
To view or add a comment, sign in
-
-
🚀 Day 57 of My Java DSA Journey Today I worked on a classic Dynamic Programming problem: 💡 Subset Sum Problem 🧠 Approach: • Used recursion with memoization • At each step, decided whether to include or exclude an element • Stored intermediate results to optimize performance 🔍 Key Insight: A subset with sum k exists if: We can form k without current element OR We can form k - arr[i] including current element ⚡ What I learned: • DP pattern similar to Knapsack • Importance of proper memoization • Handling boolean DP states 🔥 Complexity: • Time: O(n × k) • Space: O(n × k) 🎯 Takeaway: Many DP problems are variations of a few core patterns. #Day57 #90DaysOfCoding #DSA #DynamicProgramming #Java
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