topic: LeetCode Problems
LeetCode 1448: Count Good Nodes in Binary Tree with DFS Path Maximum
Learn how to count good nodes in a binary tree by carrying the maximum value seen along each root-to-node path with recursive DFS.
Blog
Filter by tag or collection, then open each note for Markdown-based writeups from daily learning, courses, books, and technical topics.
topic: LeetCode Problems
Learn how to count good nodes in a binary tree by carrying the maximum value seen along each root-to-node path with recursive DFS.
topic: LeetCode Problems
Learn how inorder traversal turns a binary search tree into sorted order and lets us stop early at the kth smallest value.
topic: LeetCode Problems
Learn how to validate a binary search tree by carrying strict lower and upper bounds through a depth-first traversal.
topic: LeetCode Problems
Learn how to compare two binary trees node by node using synchronized recursive depth-first search in C++.
topic: LeetCode Problems
Learn how to find the lowest common ancestor of two nodes by using the ordering property of a binary search tree.
topic: LeetCode Problems
Learn how to detect an exact binary-tree subtree by combining depth-first search with a recursive same-tree comparison.
topic: LeetCode Problems
Learn how recursive depth-first search computes the maximum depth of a binary tree, with intuition, correctness proof, complexity analysis, and C++ code.
topic: LeetCode Problems
Learn how to solve LeetCode Contains Duplicate efficiently in C++ using an unordered_set, with intuition, correctness analysis, and a step-by-step walkthrough.
topic: LeetCode Problems
Learn how to invert a binary tree by swapping every node's left and right children with a simple recursive depth-first search.
course: Introduction to Machine Learning
Build a rigorous foundation for machine learning through supervised and unsupervised learning, generalization, inductive bias, evaluation, and the statistical view before studying individual algorithms.
topic: Machine Learning Algorithms
Build Linear Regression from simple and multiple prediction through residual loss, model limitations, Lasso and Ridge regularization, and leakage-safe cross-validation.
topic: LeetCode Problems
Learn how to count car fleets by sorting cars by position, calculating arrival times, and maintaining a monotonic stack.
topic: LeetCode Problems
Learn how to find the next warmer day efficiently using a monotonic stack, with a correctness proof and detailed complexity analysis.
topic: Machine Learning Algorithms
Derive hard-margin Support Vector Machines from geometric distance and maximum-margin boundary selection through support vectors, duality, limitations, and a leakage-safe scikit-learn workflow.
topic: LeetCode Problems
Learn how to evaluate a Reverse Polish Notation expression efficiently in C++ by using a stack to store operands and intermediate results.
topic: Machine Learning Algorithms
Build Logistic Regression from the linear score to sigmoid probabilities, log-odds, cross-entropy, gradient updates, softmax, and a leakage-safe scikit-learn pipeline.
topic: LeetCode Problems
Learn how to design a stack that supports push, pop, top, and minimum retrieval in constant time by storing the minimum at every stack state.
topic: LeetCode Problems
Learn how to validate nested brackets using a stack, understand the LIFO pattern, prove correctness, and analyze the time and space complexity.
topic: Machine Learning Algorithms
Build an intuitive and mathematical understanding of the Perceptron through a machine-monitoring classification example, from decision boundaries and weight updates to limitations and scikit-learn.