🚀 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
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
-
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 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
-
-
📘 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
-
-
Today I solved LeetCode 101 – Symmetric Tree. 🧩 Problem Summary: Given the root of a binary tree, check whether it is symmetric (mirror of itself). A tree is symmetric if the left subtree is a mirror reflection of the right subtree. 💡 Key Concepts Used: Binary Trees Recursion Depth First Search (DFS) Tree comparison 🧠 Approach: Define a helper function to compare two nodes. Check if: Both nodes are null → symmetric One is null → not symmetric Values are equal → continue checking Recursively compare: Left subtree of left node with right subtree of right node Right subtree of left node with left subtree of right node If all checks pass, the tree is symmetric. This ensures a mirror comparison of the tree structure. 📚 What I Learned: How to compare two trees using recursion. Understanding mirror symmetry in binary trees. Strengthening DFS and recursive thinking. Breaking problems into smaller subproblems. Improving problem-solving skills one step at a time 🌳 Consistency is the key to growth 🚀 #LeetCode #DSA #BinaryTree #SymmetricTree #DFS #Recursion #Java #CodingJourney #ProblemSolving #100DaysOfCode #TechGrowth
To view or add a comment, sign in
-
-
LeetCode Challenge – Day 51 Today I solved the Diameter of Binary Tree problem. Problem Insight: The task is to find the length of the longest path between any two nodes in a binary tree. The path does not necessarily pass through the root. Approach: Used Depth First Search (DFS) to calculate the height of each subtree For every node: Calculated left subtree height Calculated right subtree height Updated the maximum diameter as the sum of left and right heights Returned the maximum diameter found during traversal Key Learning: Tree problems often combine multiple concepts. Here, calculating height and updating diameter together in a single traversal makes the solution efficient. Complexity: Time: O(n) Space: O(h) This problem helped me understand how recursion can be used to compute multiple values in a single traversal. #LeetCode #Java #DSA #CodingJourney
To view or add a comment, sign in
-
🚀 Day 34 of #GFG60 — Leveling Up in Graphs Today’s problem: Course Schedule I 🔍 Key Concepts: • Directed Graph • Topological Sorting (Kahn’s Algorithm) • Indegree tracking • Cycle detection 💡 Learned how to determine if all courses can be completed by detecting cycles in a directed graph using BFS. This is where DSA starts getting real — graphs, dependencies, and logic building 🔗 📈 One more day of showing up. #GeeksforGeeks #DSA #CodingJourney #Java #GraphTheory #Consistency #KeepGrinding
To view or add a comment, sign in
-
-
🚀 Day 92 – #100DaysOfCode Qn. Combination Sum III Today I worked on the Combination Sum III problem using recursion and backtracking in Java. 🔹 Problem Summary: Find all possible combinations of k numbers that add up to n, using numbers 1–9 only once. 🔹 My Approach: Used recursion to explore all possible number combinations. Maintained a running sum and a temporary list. When the sum equals n and the list size equals k, the combination is added to the result. Used a HashSet to avoid duplicate combinations. 🔹 Key Learning: This problem helped me strengthen my understanding of: Backtracking Recursive decision trees Managing state during recursion (adding/removing elements) 📌 Next Goal: Optimize the solution further by avoiding the HashSet and pruning unnecessary recursive calls. #Day92 #LeetCode #DSA #Java #Recursion #Backtracking #CodingJourney
To view or add a comment, sign in
-
-
Day 74 of #100DaysOfLeetCode 💻✅ Solved #162. Find Peak Element problem in Java. Approach: • Used Binary Search technique to efficiently find the peak element • Set two pointers, left at start and right at end of the array • Calculated mid index using safe mid formula • Compared nums[mid] with nums[mid + 1] to determine direction • If mid element is smaller, moved search space to right half • Otherwise, moved search space to left half including mid • Continued until left and right pointers converged • Final position (left == right) represents the peak index Performance: ✓ Runtime: 0 ms (Beats 100.00% submissions) 🚀 ✓ Memory: 44.32 MB (Beats 25.49% submissions) Key Learning: ✓ Strengthened understanding of Binary Search on unsorted arrays ✓ Learned how to apply divide-and-conquer beyond traditional searching ✓ Improved intuition for peak finding using neighbor comparison ✓ Practiced optimizing search space instead of linear scanning Learning one problem every single day 🚀 #Java #LeetCode #DSA #BinarySearch #Arrays #ProblemSolving #CodingJourney #100DaysOfCode
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