🚀 50 Days of Java – Day 47 🚀 Continuing my #50DaysOfJava journey by exploring Graph Data Structures in Java 📊💻 📘 What I covered today: • Implemented Breadth First Search (BFS) Traversal in a graph • Represented the graph using an Adjacency List • Used a Queue to process nodes level by level • Learned how BFS helps in exploring vertices in a systematic way BFS is widely used in graph problems such as shortest path in unweighted graphs, network traversal, and level-order exploration. Sharing my daily learning and code on GitHub to stay consistent 🚀 🔗 GitHub repo: (https://lnkd.in/gsYf6Kkm) Almost at the finish line of the challenge 💪 #Java #50DaysOfJava #Day47 #Graphs #BFS #DataStructures #DSA #LearningInPublic #CodingJourney #bca #student #invertis_university
More Relevant Posts
-
🚀 50 Days of Java – Day 49 🚀 Continuing my #50DaysOfJava journey by solving another interesting Graph problem using DFS 💻📊 📘 What I covered today: • Wrote a Java program to print all paths from source to target in a graph • Used Depth First Search (DFS) to explore different paths • Represented the graph using an Adjacency List • Learned how DFS can help in exploring multiple possible paths between nodes This problem helped me understand how graph traversal can be used to explore and track different routes in a network. Sharing my daily learning and code on GitHub to stay consistent 🚀 🔗 GitHub repo: (https://lnkd.in/ezZkPqxt) Almost at the final day of the challenge 💪 #Java #50DaysOfJava #Day49 #Graphs #DFS #DataStructures #DSA #LearningInPublic #CodingJourney #bca #student #invertis_university
To view or add a comment, sign in
-
🚀 50 Days of Java – Day 48 🚀 Continuing my #50DaysOfJava journey by exploring another important Graph traversal algorithm 💻📊 📘 What I covered today: • Implemented Depth First Search (DFS) Traversal in a graph • Represented the graph using an Adjacency List • Used recursion to explore nodes deeply before backtracking • Understood how DFS helps in exploring paths and connected components DFS is widely used in problems like cycle detection, path finding, and topological sorting. Sharing my daily learning and code on GitHub to stay consistent 🚀 🔗 GitHub repo: (https://lnkd.in/gQtJYtNy) Getting closer to completing the challenge 💪 #Java #50DaysOfJava #Day48 #Graphs #DFS #DataStructures #DSA #LearningInPublic #CodingJourney #bca #student #invertis_university
To view or add a comment, sign in
-
🚀 Day 37/60 – DSA Challenge Today’s problem was all about finding the first unique character in a string using HashMap in Java. At first glance, the logic seemed straightforward — store frequencies and then find the first character with count 1. But while implementing, I ran into a tricky NullPointerException 😅 🔍 Key Learning: Even a small mistake in data types can break your logic. I accidentally used int instead of char while retrieving keys from the HashMap, which led to a mismatch and returned null. 💡 Fix: Always ensure the key type matches exactly with what you stored in the HashMap. 📌 What I practiced today: HashMap frequency counting String traversal Debugging NullPointerException Importance of data types in Java Every day is a step closer to mastering problem-solving 💪 #Day37 #60DaysOfCode #DSA #Java #CodingJourney #LearningEveryday
To view or add a comment, sign in
-
-
📘 DSA Practice Session – Finding Maximum Element in an Array | Java Today I practiced a fundamental Data Structures & Algorithms concept — finding the maximum element in an array using Java. 🔍 What I implemented: A simple linear search approach to find the largest value in an integer array by iterating through each element and comparing it with a running maximum. 💡 Key Concepts Covered: ∙ Array traversal using a for loop ∙ Conditional comparison logic ∙ Initializing max with the first element (arr[0]) ⚠️ Bug I encountered & fixed: Got an ArrayIndexOutOfBoundsException on the first run — a classic beginner mistake! Debugged and fixed it successfully. #java #dsa #program #practice #problem #solve #javaprogram #oops #array #loop #exception
To view or add a comment, sign in
-
-
🚀 Day 58 / 100 – LeetCode Challenge ✅ Problem Solved: Binary Tree Postorder Traversal 📊 Difficulty: Easy 💻 Language: Java Today’s problem focused on understanding tree traversal, specifically Postorder Traversal (Left → Right → Root). 🔍 Key Learnings: Mastered recursive approach for tree traversal Understood how DFS (Depth First Search) works in binary trees Strengthened problem-solving with clean and efficient logic ⚡ Performance: Runtime: 0 ms (Beats 100%) 🔥 Memory: 42.96 MB 💡 Approach: Used a simple recursive helper function: Traverse left subtree Traverse right subtree Add root node value This problem may be easy, but it builds a strong foundation for advanced tree problems 💪 📈 Consistency is key — 58 days down, 42 more to go! #LeetCode #100DaysOfCode #Java #DataStructures #CodingJourney #BinaryTree #DSA #Learning #Consistency
To view or add a comment, sign in
-
-
🚀 DAY 75/150 — LEVEL ORDER TRAVERSAL IN ACTION! 🌳🔥 Day 75 of my 150 Days DSA Challenge in Java — halfway through the journey and stronger every day 💻🧠 Today I solved a problem that deepens my understanding of Binary Trees using BFS (Level Order Traversal). 📌 Problem Solved: Maximum Level Sum of a Binary Tree 📌 LeetCode: #1161 📌 Difficulty: Medium The task is to find the level of a binary tree where the sum of node values is maximum. If multiple levels have the same sum, return the smallest level number. 🔹 Approach Used I used Breadth-First Search (BFS) with a queue: • Traverse the tree level by level • For each level: Calculate the sum of all nodes • Track the level with the maximum sum This approach ensures we process nodes in the correct level order. ⏱ Complexity Time Complexity: O(n) Space Complexity: O(n) (due to queue storage) 🧠 What I Learned • BFS is ideal for problems involving levels in a tree • Queue plays a key role in level-order traversal • Tracking level-wise data helps solve many tree-based problems 💡 Key Takeaway This problem helped me understand how to process trees layer by layer, which is very useful for: Level-based problems Shortest path (in graphs) Tree traversals 🌱 75-Day Reflection At Day 75, I’ve learned: Arrays, Strings, Hashing Recursion & Backtracking Stack, Queue, Greedy And now diving deeper into Binary Trees The biggest lesson so far? 👉 Consistency beats everything. ✅ Day 75 completed 🚀 75 days to go 🔗 Java Solution on GitHub: 👉 https://lnkd.in/gcg9b9eT 💡 Halfway there — building logic, discipline, and confidence every day. #DSAChallenge #Java #LeetCode #BinaryTree #BFS #150DaysOfCode #ProblemSolving #CodingJourney #InterviewPrep #LearningInPublic #Consistency
To view or add a comment, sign in
-
-
Day 64 of #100DaysOfLeetCode 💻✅ Solved #724. Find Pivot Index problem in Java. Approach: • Calculated the total sum of the array • Maintained a variable left to track left sum • For each index, computed right sum as total - left - nums[i] • Compared left and right sums • If both are equal, returned the index as pivot • Updated left sum by adding current element Performance: ✓ Runtime: 1 ms (Beats 98.68% submissions) 🚀 ✓ Memory: 47.58 MB (Beats 32.00% submissions) Key Learning: ✓ Learned prefix sum technique for efficient calculations ✓ Practiced reducing time complexity from O(n²) to O(n) ✓ Strengthened understanding of array traversal and sum logic Learning one problem every single day 🚀 #Java #LeetCode #DSA #Arrays #PrefixSum #ProblemSolving #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
Day 46 of #100DaysOfLeetCode 💻✅ Solved #374. Guess Number Higher or Lower problem in Java. Approach: • Used Binary Search to efficiently guess the number. • Calculated mid using low + (high - low) / 2 to avoid overflow. • Used the guess(mid) API to check if the number is higher, lower, or correct. • Updated the search range accordingly until the number was found. Performance: ✓ Runtime: 0 ms (Beats 100% submissions) 🚀 ✓ Memory: 41.68 MB (Beats 97.84% submissions) Key Learning: ✓ Practiced implementing binary search on a real problem ✓ Learned how to safely calculate mid to prevent integer overflow ✓ Strengthened problem-solving skills with search algorithms Learning one problem every single day 🚀 #Java #LeetCode #DSA #BinarySearch #ProblemSolving #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
Day 66 of #100DaysOfLeetCode 💻✅ Solved #3427. Sum of Variable Length Subarrays problem in Java. Approach: • Iterated through each index of the array • Determined the starting index using i - nums[i] • Ensured the start index does not go below 0 • Calculated sum of elements from start to current index i • Added each subarray sum to the total Performance: ✓ Runtime: 1 ms (Beats 99.90% submissions) ✓ Memory: 45.22 MB (Beats 56.30% submissions) Key Learning: ✓ Practiced handling variable-length subarrays ✓ Improved understanding of index-based range calculations ✓ Strengthened nested loop logic for array problems Learning one problem every single day 🚀 #Java #LeetCode #DSA #Arrays #PrefixSum #ProblemSolving #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Day 99 of My 100 Days LeetCode Challenge | Java Today’s problem was all about randomization and linked list traversal — a nice break from heavy DP and matrices. The challenge was to design a system that returns a random node’s value from a singly linked list, ensuring that every node has an equal probability of being chosen. Since linked lists don’t allow direct indexing, the key idea was to first determine the size of the list, and then generate a random index to fetch the corresponding node. This approach ensures uniform randomness while keeping the implementation simple and efficient. ✅ Problem Solved: Linked List Random Node ✔️ All test cases passed (8/8) ⏱️ Runtime: 11 ms 🧠 Approach: Linked List Traversal + Randomization 🧩 Key Learnings: ● Randomization problems require ensuring uniform probability distribution. ● Linked lists limit direct access, so traversal becomes essential. ● Precomputing size can simplify random selection. ● Sometimes simple approaches are the most effective. ● Understanding data structure limitations helps design better solutions. This problem highlighted how probability + data structures can come together in elegant ways. 🔥 Day 99 complete — sharpening my understanding of randomization and linked list behavior. #LeetCode #100DaysOfCode #Java #LinkedList #Randomization #Algorithms #ProblemSolving #DSA #CodingJourney #Consistency
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