Day 178: Beyond the Array 🔗 Today, I moved away from the comfort of Arrays and tackled a fundamental building block of Data Structures: Linked Lists. While Arrays are great for quick access, Linked Lists taught me the power of manual memory management and pointer manipulation. I spent the day implementing LeetCode 707 (Design Linked List) from scratch in JavaScript. Key takeaways from today’s build: ✅ Dynamic Growth: Unlike arrays, I don’t need to "shift" elements to add to the front. It’s a simple $O(1)$ re-wiring of pointers. ✅ The Traverse: To find a value, you have to walk the chain. $O(n)$ search is the trade-off for flexible insertion. ✅ Garbage Collection: Deleting isn’t about erasing data; it’s about "unlinking" it so the system can reclaim that space. Mastering the logic of node.next and head is a rite of passage. It’s making me a more conscious programmer—thinking about how data is actually structured in memory rather than just how it looks on the screen. Next up: Reversing the list and tackling Doubly Linked Lists! 🚀 #100DaysOfCode #JavaScript #DSA #LinkedList #LeetCode #SoftwareEngineering #ProblemSolving #CodingJourney #BuildInPublic
Learning Linked Lists in JavaScript with LeetCode 707
More Relevant Posts
-
Day 6: Closures - Understanding how functions remember variables. Today I learned: - What closures are (functions accessing parent scope variables) - Creating private variables with closures - Building a counter with increment and getCount methods Small wins: - Struggled understanding closure concept → Realized it's like "function takes memory with it" - Didn't know how to structure return object with methods → Session 2 knowledge helped Closures are the foundation of data encapsulation in JavaScript. Code: https://lnkd.in/gtT73HVR 144 days remaining. #JavaScript #BackendDeveloper #Closures #100DaysOfCode
To view or add a comment, sign in
-
-
I’ve decided to stop just "watching" and start "doing." Today was all about getting deep into the JavaScript fundamentals that actually make a difference in real-world projects. It’s one thing to see a tutorial, but it’s another thing to actually write the logic and see it work! Here is what my practice session looked like today: ✅ Modernizing my Code: Switched to const and let for better safety and started using Arrow Functions to keep my logic concise and readable. ✅ The Power of Clean Data: I finally grasped how Object & Array Destructuring saves so much time when pulling out specific data. No more repetitive code! ✅ The Magic of Three Dots (...): Used the Spread Operator to handle arrays and pass parameters into functions effortlessly. ✅ Object Control: Explored how to manage objects using Keys, Values, and Entries. I also learned about Object.freeze and Object.seal—essential for keeping data secure. ✅ Bug Prevention: Started using Optional Chaining (?.). This is a total game-changer for avoiding those annoying "cannot read property" errors when dealing with nested data. ✅ Smart Looping: Practiced the difference between for...in and for...of to make sure I’m always using the right tool for the job. Every line of code I write feels like I'm building a stronger bridge toward becoming a Full-Stack Developer. Consistency is the key! 🔑 #JavaScript #WebDev #CodingJourney #LearningToCode #Frontend #Programming
To view or add a comment, sign in
-
-
Day 16 of #100DaysOfCode: Goodbye, For-Loops. 👋 Today I forced myself to stop using for loops. I spent the entire session mastering JavaScript's higher-order array methods: map, filter, and reduce. To make sure I actually understood it, I set a rule: Type everything from memory. No copy-pasting. What I built: A statistics script that takes raw data and processes it in a single flow. map to transform data (doubling numbers). filter to clean data (keeping evens). reduce to crunch data (summing & calculating averages). The Aha Moment: The power of Chaining. Instead of writing 10 lines of loop logic, I can do this: JavaScript const result = numbers .filter(n => n % 2 === 0) .map(n => n * 2) .reduce((acc, n) => acc + n, 0); It reads like a sentence. DSA Update: No DSA today. I wanted to drill these array methods until they became muscle memory. #JavaScript #WebDevelopment #CleanCode #FunctionalProgramming #100DaysOfCode
To view or add a comment, sign in
-
I made SyntaxShift, a better transform tool for Devs. All of these comes with a Custom logic on the FrontEnd Engine. > json-to-typescript > json-schema-to-typescript (with fallback inference) > svg-to-jsx > html-to-jsx > python-to-javascript > javascript-to-python Library-backed > yaml-to-json and json-to-yaml → js-yaml > xml-to-json → fast-xml-parser > markdown-to-html → marked Collaborate here -> https://lnkd.in/dxqrVEnn Live -> https://lnkd.in/d2J5ZG9i
To view or add a comment, sign in
-
-
🚀 LeetCode: Two Sum II - Input Array Is Sorted The goal is to find two numbers in a 1-indexed sorted array that add up to a specific target sum. Since the array is already sorted, we can find the indices efficiently without extra storage. 🛠️ My Approach 1. Initialization: I used two pointers, i starting at the beginning (index 0) and j at the end of the array. 🔡 2. Sorted Property Leverage: Instead of a nested loop, I compared the sum of elements at i and j to the target. If the sum is too high, I decrement j; if it's too low, I increment i. 🧹 3. Two-Pointer Optimization: By narrowing the window from both sides, I found the exact pair in a single pass. 📍 4. One pointer moves from the start (i), and the other from the end (j). ❌ If the sum matches the target, we return the 1-indexed positions [i + 1, j + 1] and break the loop. 📊 Efficiency Analysis ⏱️ Time Complexity: O(n) 💾 Space Complexity: O(1) #LeetCode #JavaScript #CodingLife #Algorithms #WebDevelopment #ProblemSolving #SoftwareEngineering #TechCommunity
To view or add a comment, sign in
-
-
From Sorted Data to Balanced Trees: Divide, Conquer, Balance 🌳 Solved LeetCode 108 - Convert Sorted Array to Binary Search Tree today. The solution clicked by treating the array like a search space: -Pick the middle element as the root -Recursively build the left half and right half -Stop when the range becomes invalid This guarantees a height-balanced BST without extra work. Key takeaway: Balanced trees are a natural outcome of divide-and-conquer. Choosing the midpoint at every step keeps depth under control. Strengthening recursive thinking and tree intuition. #LeetCode #DSA #BinarySearchTree #Recursion #DivideAndConquer #JavaScript #ProblemSolving #LearnInPublic
To view or add a comment, sign in
-
In WASM, the painful part isn’t when it crashes. It’s when it crashes silently. When 🦀 Rust crosses into WebAssembly, you get a new frontline: the error and type boundary between Rust and JavaScript. If that boundary isn’t disciplined, bugs turn into “something went wrong” with no context, no repro path, and no way to debug quickly. In a small Rust↔JS module, I try to keep that boundary in shape with three simple moves: • Safe execution — wrap calls with `catch_unwind` so a panic becomes `Result<_, JsValue>` with context instead of undefined behavior in JS. • Safe deserialization — decode any incoming `JsValue` into a Rust type via `serde_wasm_bindgen` and return failures as labeled `JsValue` errors. • Transparent debug logging — when a debug flag is on, log decoded/result values; otherwise, stay quiet. This isn’t “perfect architecture”. It’s a pragmatic contract: errors should be returnable, labeled, and diagnosable. Curious how others handle this in Rust↔JS/WASM: do you prefer string messages at the boundary (simple), or structured error objects (more work, but a stable contract)?
To view or add a comment, sign in
-
✅ Solved LeetCode: Binary Tree Preorder Traversal (144) Implemented a recursive Preorder Traversal in JavaScript to visit all nodes of a binary tree in the correct sequence: Root -> Left -> Right. The approach uses a helper function traversal(curr) that: - First processes the current node (traverse its value to the result array). - Recursive traverses the left subtree. - Then recursively traverse the right subtree. The solution runs in O(n) time, where n is the number of nodes in the tree, and uses O(h) space for the recursion stack (where h is the height of the tree).
To view or add a comment, sign in
-
-
Consistency > excuses. That’s today’s win. Day 10 | JavaScript – Objects Yesterday I missed posting. Today, I didn’t repeat that mistake. After getting comfortable with functions, I moved into objects — a cleaner and more powerful way to store related data. What I learned today: 1. Creating objects using { } 2. Storing data as key–value pairs 3. Accessing: -the whole object -individual properties using dot (.) notation 4. Updating values by reassigning properties 5. Removing properties completely using the delete keyword Objects made it clear how JavaScript organizes real-world data — not just values, but structure. Learning. Day 10 done. #JavaScript #Objects #LearningInPublic #WebDevelopment #DeveloperJourney
To view or add a comment, sign in
-
Data Structures & String Magic Today was all about how we store and manipulate data in JavaScript. I moved beyond simple variables and explored the power of Strings and Objects. It’s fascinating to see how similar Strings and Arrays can be, yet how unique they are in their behavior! My Learning Milestones Today: String Mastery: Explored slice, join, concat, and the importance of case normalization (toLowerCase/toUpperCase) for comparisons. The "Reverse" Challenge: Learned three different ways to reverse a string—a classic interview favorite! Object Essentials: Introduction to Properties and Values. I practiced multiple ways to "get" and "set" data using dot notation and bracket notation. Advanced Object Ops: Working with nested objects, using Object.keys() and Object.values(), and learning how to safely delete properties. Iteration: Mastering how to loop through objects to pull out the data I need. Objects are truly the backbone of JavaScript, and I'm feeling much more confident in how to structure my code. 🚀 #JavaScript #WebDevelopment #CodingJourney #StringsAndObjects #FrontendDev #TechGrowth
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