You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: PROGRESS.md
+10-2Lines changed: 10 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -182,17 +182,25 @@ Practiced two fundamental problems around square roots using binary search. In t
182
182
183
183
## 📅 Day 20 – Bit Manipulation Basics
184
184
- ✅ [Power of Two](https://github.com/lyushher/LeetCode-Python-Easy-DSA/blob/main/day-20/power_of_two.py)
185
-
- ✅ [Number of 1 Bits]([https://github.com/lyushher/LeetCode-Python-Easy-DSA/blob/main/day-20/power_of_two.py](https://github.com/lyushher/LeetCode-Python-Easy-DSA/blob/main/day-20/number_of_1_bits.py))
185
+
- ✅ [Number of 1 Bits](https://github.com/lyushher/LeetCode-Python-Easy-DSA/blob/main/day-20/number_of_1_bits.py)
186
186
187
187
**Notes:**
188
188
Explored two classic bit manipulation problems. In the first, verified whether a number is a power of two by leveraging the property that such numbers have exactly one set bit in their binary representation, using the condition `n > 0` and `n & (n - 1) == 0` for a constant-time check. In the second, counted the number of set bits in an integer by applying Brian Kernighan’s algorithm, repeatedly clearing the lowest set bit with `n & (n - 1)` and incrementing a counter, which ensures efficient O(k) runtime where k is the number of 1-bits. Both problems highlight how bitwise operations provide elegant, high-performance solutions to fundamental questions.
189
189
190
190
---
191
191
192
-
📅 Day 21 – Tree Depth & Structural Equality
192
+
## 📅 Day 21 – Tree Depth & Structural Equality
193
193
194
194
- ✅ [Maximum Depth of Binary Tree](https://github.com/lyushher/LeetCode-Python-Easy-DSA/blob/main/day-21/maximum_depth_of_binary_tree.py)
Worked on two fundamental binary tree problems. In the first, computed the maximum depth of a binary tree by recursively exploring both subtrees and returning `1 + max(left, right)`, ensuring every node is visited exactly once and the longest path from root to leaf is measured. In the second, determined whether two trees are identical by recursively comparing node values and structure in parallel, confirming equality only when both subtrees matched completely. These problems reinforce core DFS recursion patterns on trees, emphasizing structural traversal and balanced handling of base cases.
**Notes:** Focused on structural transformations of binary trees. In the first problem, checked whether a binary tree is symmetric by recursively comparing mirrored node pairs from the left and right subtrees, ensuring both values and structures matched in a mirror-like fashion. In the second, inverted the binary tree by recursively swapping the left and right children of each node, propagating local changes into a complete tree-wide transformation. Together, these problems emphasize recursive divide-and-conquer strategies, mirrored traversals, and how small, consistent operations applied at each node can globally reshape a tree.
0 commit comments