Recent posts

[LeetCode] 814. Binary Tree Pruning

/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: TreeNode* pruneTree(TreeNode* root) { if (root->

[Math] Exact Differential Equation

Form$$ M(x, y) + N(x, y)y' = 0 $$Test for Exactness$$ \dfrac{ \partial N }{ \partial x } = \dfrac{ \partial M }{ \partial y } $$Suppose M, N, ∂N/∂x and ∂M/∂y are continuous for

[DM] De Morgan's Law 迪摩根定理

基本$$ \neg ( P \lor Q ) \equiv ( \neg P ) \land ( \neg Q ) $$$$ \neg ( P \land Q ) \equiv ( \neg P ) \lor ( \neg Q ) $$$$ ( P \lor Q ) \equiv \neg ( \neg P \land \neg Q ) $$$$ ( P \land