🚀 50 Days of Java – Day 38 🚀 Continuing my #50DaysOfJava journey by implementing Queue using Array (Linear Queue) in Java 💻 📘 What I covered today: • Implemented Linear Queue using Array • Understood FIFO (First In, First Out) concept • Performed queue operations: "enqueue", "dequeue", and "peek" • Learned conditions for queue overflow and underflow Implementing Queue from scratch helped me understand how data flows sequentially and how memory is managed internally. Sharing my daily learning and code to stay consistent 🚀 🔗 GitHub repo: (https://lnkd.in/g-g5rVyM) Step by step strengthening my DSA concepts 💪 #Java #50DaysOfJava #Day38 #Queue #LinearQueue #DataStructures #DSA #LearningInPublic #CodingJourney #Bca #Student
More Relevant Posts
-
🚀 50 Days of Java – Day 39 🚀 Continuing my #50DaysOfJava journey by learning and implementing Circular Queue using Array in Java 💻 📘 What I covered today: • Implemented Circular Queue using Array • Understood efficient memory utilization compared to Linear Queue • Learned circular increment using modulo operation • Performed queue operations: "enqueue", "dequeue", and "peek" Circular Queue helps overcome the limitations of linear queues by reusing empty spaces efficiently. Sharing my daily learning and code to stay consistent 🚀 🔗 GitHub repo: (https://lnkd.in/gY4QQiFk) Consistently building strong Data Structure concepts 💪 #Java #50DaysOfJava #Day39 #CircularQueue #Queue #DataStructures #DSA #LearningInPublic #CodingJourney #bca #student
To view or add a comment, sign in
-
🚀 50 Days of Java – Day 40 🚀 Continuing my #50DaysOfJava journey by implementing Queue using Linked List in Java 💻 📘 What I covered today: • Implemented Queue using Linked List • Understood FIFO (First In, First Out) working principle • Performed queue operations: "enqueue", "dequeue", and "peek" • Learned advantages of dynamic memory allocation over array-based queues Implementing queue using Linked List helped me understand how dynamic data structures efficiently manage memory. Sharing my daily learning and code to stay consistent 🚀 🔗 GitHub repo: (https://lnkd.in/gYXNKNCZ) Step by step strengthening my DSA journey 💪 #Java #50DaysOfJava #Day40 #Queue #LinkedList #DataStructures #DSA #LearningInPublic #CodingJourney #bca #student
To view or add a comment, sign in
-
🚀 Day 23 / 180 – DSA with Java 🚀 📘 Topic Covered: Linked List Manipulation 🧩 Problem Solved: Delete Node in a Linked List Problem: Given a node in a singly linked list (not the head), delete that node without access to the previous node. Approach: Since the previous node is not accessible, copied the value of the next node into the current node and updated the pointer to skip the next node, effectively deleting it. Key Learning: ✔️ Thinking differently when constraints change ✔️ Understanding pointer manipulation in linked lists ✔️ Solving problems by modifying node structure directly 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 22 of my Java DSA Journey Back after a short break — now continuing with consistency. Today’s problem: Merge Two Sorted Lists (LeetCode #21) 🔹 Topic: Linked List 🔹 Pattern: Two Pointer Technique 💡 Key Idea: We use two pointers to traverse both sorted linked lists and build a new sorted list by always picking the smaller node. Instead of creating new nodes, we simply adjust the existing node pointers — making the solution efficient. 🧠 Key Learning: Linked List problems are more about pointer manipulation than logic complexity. Once you understand how pointers move, problems become much easier. 📊 Complexity: • Time: O(n + m) • Space: O(1) Consistency > Perfection. Back to the grind. 🔗 GitHub Solution: https://lnkd.in/gTzbQeTV #Java #DSA #LinkedList #LeetCode #ProblemSolving #CodingJourney
To view or add a comment, sign in
-
-
🚀 Day 23 of my Java DSA Journey Today I worked on Linked List Cycle — LeetCode #141 🔹 Topic: Linked List 🔹 Pattern: Fast & Slow Pointers (Floyd’s Algorithm) 💡 Key Idea: Instead of using extra space like a HashSet, we use two pointers: • Slow pointer moves 1 step • Fast pointer moves 2 steps If a cycle exists, the fast pointer will eventually meet the slow pointer inside the loop. 🧠 Key Learning: The real trick is understanding why they meet — Fast pointer gains one step every move, so in a loop it will always catch up. 📊 Complexity: • Time: O(n) • Space: O(1) Sharing a visual breakdown of the algorithm 👇 Back to building consistency. 🔗 GitHub Solution: https://lnkd.in/gQRv2Qp3 #Java #DSA #LinkedList #LeetCode #ProblemSolving #CodingJourney
To view or add a comment, sign in
-
-
🚀 Day 5 of My DSA Journey (Java) Today’s problem: Subarray Sums Divisible by K 📌 Problem Summary: Given an integer array and a value k, find the number of subarrays whose sum is divisible by k. 💡 Key Learning: The brute-force approach would be too slow, so I explored an optimized solution using: Prefix Sum HashMap for storing remainder frequencies 🔍 Core Insight: If two prefix sums have the same remainder when divided by k, the subarray between them is divisible by k. ⚙️ Approach: Maintain a running sum Compute remainder: (sum % k + k) % k (to handle negatives) Use a HashMap to count frequencies of remainders Add to count when remainder repeats 🧠 What I Improved Today: Better understanding of prefix sum patterns Handling negative modulo cases Writing clean and efficient Java code ✅ Time Complexity: O(n) ✅ Space Complexity: O(k) 📷 I’ve attached my handwritten notes + implementation for better clarity Consistency is key 🔁 — learning something new every day! #DSA #Java #CodingJourney #LeetCode #ProblemSolving #100DaysOfCode
To view or add a comment, sign in
-
🚀 Day 61 of My DSA Journey Today I solved Merge K Sorted Linked Lists using a Min Heap (Priority Queue) approach in Java. 🧠 Problem Given an array of k sorted linked lists, merge them into one sorted linked list. 💡 Approach: Min Heap (Priority Queue) Instead of merging lists one by one, we can always pick the smallest node among the current heads of all lists. Steps: i) Create a Min Heap (PriorityQueue) that stores nodes based on their values. ii) Add the head of each linked list to the heap. iii) Extract the smallest node from the heap. iv) Attach it to the result list. v) If the extracted node has a next node, push it into the heap. vi) Repeat until the heap becomes empty. This ensures we always select the next smallest element efficiently. ⏱️ Complexity Time Complexity: O(N log K) N = total number of nodes K = number of linked lists Space Complexity: O(K) for the priority queue. 📌 Key Learning Using a Priority Queue (Min Heap) helps efficiently track the smallest element among multiple sorted lists, making this approach optimal. #Day61 #DSA #Java #LeetCode #DataStructures #CodingJourney
To view or add a comment, sign in
-
-
Day 2 of Learning Java : Today I started my journey into Java programming which is taught by Aditya Tandon Sir. Here are the key concepts I learned today: JVM, JRE, JDK. •JVM:- (Java Virtual Machine) When you write Java code, it doesn't get turned directly into machine code (0s and 1s). The compiler turns your code into an intermediate format called Bytecode. The JVM takes that Bytecode and executes it on your specific device •JRE (Java Runtime Environment): JVM + Libraries. This is what an end-user needs to install to run a Java app on their computer. •JDK (Java Development Kit) The "Super-set." If you are writing code, you need the JDK. It contains the compiler (javac), the debugger, and the JRE. It transforms your human-readable .java files into .class bytecode. This is just the beginning. Excited to continue this journey Special thanks to Rohit Negi bhaiya & Aditya Tandon Sir. #Day2 #Java #Coding #Learning #Consistency
To view or add a comment, sign in
-
-
When I first started learning Java, garbage collection felt like magic. 1)You create objects. 2)The program get runs. 3)Unused memory gets cleaned up. But Java memory is not just one big box. Here is the simple model: * New objects start in Young Generation * Long-living objects move to Old Generation * Unused objects get removed by the Garbage Collector Example: A temporary list created inside a method usually dies young and gets cleaned quickly. But something like cache data or a session object can survive longer and move to the Old Generation. That matters because: * Young Generation collection is usually fast * Old Generation collection is heavier * Understanding both helps you reason about performance #Java #SpringBoot #BackendDevelopment #SoftwareEngineerr #javadeveloper
To view or add a comment, sign in
-
-
✨ Day 26 of Learning Java – Exception Handling in Action ✨ Today I explored how exceptions are managed across multiple methods using try-catch-finally. In my program: The tieMethod prints a message, calls another method, and gracefully handles any exceptions. The tilMethod throws custom ArithmeticExceptions for specific inputs (0 and 10), catches them locally, and ensures the finally block always runs. The main method takes user input and demonstrates how the flow continues even when exceptions occur. 🔑 Key Takeaways Nested try-catch blocks allow different layers of exception handling. Custom messages make debugging clearer. The finally block guarantees execution, no matter what happens. Exception handling ensures programs don’t crash unexpectedly and maintain logical flow. 💡 Example: Input 0 → "ArithmeticException: / by zero" + "Finally" + "Coders" Input 5 → "Completed" + "Finally" + "Coders" This exercise strengthened my understanding of how Java ensures robust and predictable code execution. #Day26 #JavaLearning #ExceptionHandling #TryCatchFinally #CodeFlow #LearningJourney #JavaBeginners
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