🚀 Mastering Topological Sorting in JavaScript Today, I implemented Topological Sort using Kahn’s Algorithm in JavaScript! 🔥 📘 What it does: Topological sorting is used to order tasks or dependencies — like scheduling jobs, resolving build orders, or managing dependencies in a graph (DAG). 🧠 Core idea: Build an adjacency list to represent the graph. Calculate the indegree (incoming edges) for each node. Use a queue to process nodes with indegree = 0. Remove edges as you go, pushing new nodes into the queue once their indegree becomes 0. #JavaScript #Algorithms #TopologicalSort #Coding #Learning
How to implement Topological Sort in JavaScript using Kahn's Algorithm
More Relevant Posts
-
Day 28 - Cohort 2.0! Sheryians Coding School Understanding JavaScript Data Types. This session was all about exploring the core data types in JavaScript. Like float, number, string, boolean, null, array, object, symbol, undefined, NaN, Infinity and understanding the difference between primitive and reference types. These concepts form the foundation of every JavaScript program, helping us store, compare, and manage data effectively. Harsh Vandana Sharma Bhaiya explained everything so well Every day, the journey into JavaScript gets more exciting and insightful. #SheryiansCodingSchool #JavaScript #WebDevelopment #LearningJourney #Frontend #Coding
To view or add a comment, sign in
-
-
Day 319: Learnt JavaScript objects and arrays: property access, shallow vs deep copying with structuredClone(), best iteration techniques using for...of, avoiding pitfalls of for...in, destructuring with defaults, and mutating vs non-mutating array methods. Key skills for writing safe, efficient, and maintainable JS code! #dailylearning Masai #Masaiverse
To view or add a comment, sign in
-
-
📦 Day 38 — Arrays and Objects in JavaScript Today at Sheryians Coding School Cohort 2.0, I explored two of the most powerful data structures in JavaScript — Arrays and Objects. 💻✨ Here’s what we covered in class: ✅ Creating and accessing arrays ✅ Array methods like push(), pop(), shift(), unshift(), and length ✅ Looping through arrays using for and forEach ✅ Understanding objects — key–value pairs and how they store structured data ✅ Accessing and modifying object properties ✅ Combining arrays and objects for real-world examples Takeaway: Arrays and objects are the core of how JavaScript handles data. Learning them properly feels like unlocking the building blocks of every real-world project. 🚀 #Day38 #ShreyiansCodingSchool #Cohort2 #JavaScript #Arrays #Objects #FrontendDevelopment #CodingJourney #LearnByDoing #WebDevelopment
To view or add a comment, sign in
-
-
🚀Day 85 of #100DaysOfCode 👉 Today I explored the JavaScript Math object. It’s a built-in tool packed with methods for quick math calculations—no setup needed. examples: ▪️Math.ceil(4.6) --> rounds to 5 ▪️Math.floor(4.9) --> rounds down to 4 ▪️Math.pow(2, 3) --> returns 8 ▪️Math.abs(-5) --> returns 5 (gives positive number) Math object makes coding calculations simple and fast. #JavaScript #MathObject #LearnToCode #100DaysOfCode
To view or add a comment, sign in
-
-
Day 23/90 – 90 Days DSA Challenge Today I practiced another classic recursion problem — Sum of first N natural numbers using recursion 💡 🧠 Concept Recap: Recursion is when a function calls itself with a smaller input until it reaches a base condition. It’s like peeling an onion layer by layer — until you reach the core 🧅 ⚙️ Problem Statement: 👉 Write a function sum(n) that calculates the sum of the first n natural numbers. 🧩 Example: Input: 5 Process: 5 + 4 + 3 + 2 + 1 = 15 Output: 15 Time Complexity: O(n) 💾 Space Complexity: O(n) (due to call stack) ✨ Key takeaway: Recursion helps break down complex problems into smaller, simpler ones — it’s elegant, powerful, and mind-opening once you get the hang of it! #Day23 #DSA #Recursion #JavaScript #CodingChallenge #MechCode #LearningInPublic #FrontendDeveloper #CodeEveryday
To view or add a comment, sign in
-
-
⭐ Stuck in JS? That’s Where Real Learning Begins. Dived deep into advanced JS objects learned why Math.PI can’t be changed and how JavaScript locks values internally. 💡 Hitesh Choudhary Sir always says: when you get stuck in advanced concepts or errors, that’s where real learning begins. The only way out? Build something. 🚀 #JavaScript #BuildToLearn #ChaiCode
To view or add a comment, sign in
-
-
"Just wrapped up #100Devs Class 31 by @LeonNoel: ‘Inheritance & Polymorphism in JavaScript’! 🚀 Dived deep into OOP concepts like encapsulation, abstraction, inheritance, and polymorphism, with hands-on examples and practical code walkthroughs. Learning how to write scalable, maintainable JS by using classes, constructors, and the power of object-oriented paradigm. Shubham Kumar Singh.
To view or add a comment, sign in
-
Today’s JavaScript deep dive was all about design patterns 🚀 🔹 Module Pattern (IIFE) 🔹 Revealing Module Pattern (IIFE) 🔹 Factory Function Pattern I implemented each pattern in a small “bank” and “product” example to understand how they help with: Encapsulation and data privacy Cleaner, more maintainable code structure Reusability without over-engineering Next on my list: the Observer pattern (basic pub–sub) to handle events and reactive flows more elegantly. Always iterating on writing better, more scalable JavaScript. 💻✨ Sheryians Coding School #JavaScript #DesignPatterns #CleanCode #LearningJourney #Sheryians_Coding_School
To view or add a comment, sign in
-
-
Day 30 of Cohort 2.0 🚀 Today’s wrap-up was all about diving deeper into JavaScript fundamentals and understanding how the language handles operations and logic. 💻 Here’s what I learned today: 🔹 Arithmetic Operators → Perform basic mathematical operations 🔹 Assignment Operators → Assign and update variable values 🔹 Comparison Operators → Compare values and return true/false 🔹 Logical Operators → Combine multiple conditions 🔹 Ternary Operator → Write shorter conditional statements 🔹 Type Checking (typeof) → Identify data types in JavaScript 🔹 String Operations → Work with and manipulate text 🔹 Nullish Coalescing (??) → Provide default values when dealing with null or undefined 🔹 Optional Chaining (?.) → Safely access nested object properties 🔹 Hoisting → Understand how variable and function declarations are processed before execution ✨ Key takeaway: Learning these core concepts builds a strong foundation for writing clean, efficient, and bug-free JavaScript code. Sheryians Coding School #sheryianscodingschool #cohort2 #learningjourney #dailyupdates #JavaScript #WebDevelopment #Frontend
To view or add a comment, sign in
-
-
Day 32 — Loops & Conditional Logic in JavaScript | 2.0 Job-Ready AI-Powered Cohort Sheryians Coding School 🚀 Today was all about building strong control-flow logic in JavaScript: 🟡 Truthy & Falsy Values Falsy → 0, "", null, NaN, undefined, false, document.all Everything else is Truthy ✅ 🧠 Conditional Statements if, else, if-else, else-if switch Ternary Operator for compact logic 🔁 Loops for loop basics & patterns ⛔ Loop Control Statements break — exit loop continue — skip to next iteration Understanding these deeply helps write cleaner, efficient control flow and decision-making logic in JS 💡 #JavaScript #WebDevelopment #Frontend #ControlFlow #SheryiansCodingSchool #DeveloperJourney
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