Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
LeetCode 399 – Evaluate Division (C++ Graph)
Play lesson

LeetCode 75 C++ | Step-by-Step Solutions (LAN Academy) - LeetCode 399 – Evaluate Division (C++ Graph)

4.0 (1)
12 learners

What you'll learn

This course includes

  • 5.5 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

In this video we solve LeetCode 399: β€œEvaluate Division” using C++ and a clean graph + DFS/BFS approach. We are given equations like a / b = k and we need to answer queries of the form x / y = ? This is a perfect problem to learn how to model relationships as a weighted graph. What you will learn: β€’ How to build a graph where each variable is a node and each equation is a weighted edge β€’ Why this is basically a path search with product of weights β€’ How to use DFS or BFS to answer each query β€’ How to handle unknown variables and disconnected components β€’ Full C++ implementation, step by step β€’ Time and space complexity analysis πŸ”— Problem link: https://leetcode.com/problems/evaluate-division/ πŸ“š Watch the full LeetCode 75 playlist (C++ explanations + animations): https://www.youtube.com/playlist?list=PLF0G-7pZcOza_jyAxwMpa5KnK3vST5smK ––––– ⏱ Timestamps (adjust after editing) 00:00 Intro & problem statement 01:00 Turning equations into a graph 04:00 DFS/BFS idea – path product = division result 08:00 Implementing the graph in C++ (adjacency list) 13:00 Answering queries with DFS/BFS 18:00 Handling unknown variables / no path case 20:00 Time and space complexity 21:00 Recap and next problems to try ––––– πŸ’» Technologies used β€’ Language: C++ β€’ Topic: Graphs, DFS, BFS, weighted graph β€’ Difficulty: Medium β€’ Use case: Interview prep, LeetCode practice ––––– If this helped you, consider: πŸ‘ Liking the video πŸ“ Commenting which graph problem you want next βœ… Subscribing for more C++ + algorithms explanations Follow LAN Academy Website: https://lanacademy-school.thinkific.com YouTube: @lanacademy9521 Twitter: https://x.com/SolutionsLan #leetcode #leetcode399 #cpp #graph #dfs #bfs #codinginterview

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

FAQs

Course Hive
Download CourseHive
Keep learning anywhere