Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c2dddba

Browse files
Revise progress notes for Days 25 and 26
Updated progress notes for Days 25 and 26, detailing problem-solving approaches and optimizations for binary trees and array manipulation.
1 parent bc2eff5 commit c2dddba

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

‎PROGRESS.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,3 +220,19 @@ Worked on two fundamental binary tree problems. In the first, computed the maxim
220220
-[Range Sum of BST](https://github.com/lyushher/LeetCode-Python-Easy-DSA/blob/main/day-24/range_sum_of_bst.py)
221221

222222
**Notes:** Practiced two BST-focused problems that emphasize recursion and pruning. In the first, computed the minimum depth of a binary tree by carefully handling cases where one child is null, ensuring that only true leaf paths are counted. This avoids incorrectly returning zero for incomplete subtrees. In the second, optimized the sum of node values within a given range by leveraging the BST property to prune unnecessary branches: skipping the left subtree if the node value is too small, or the right if it’s too large. Both problems highlight efficient recursive traversal strategies that reduce unnecessary computation while maintaining clarity and correctness.
223+
224+
---
225+
226+
## 📅 Day 25 – Complete Trees & Leaf Sequences
227+
-[Count Complete Tree Nodes](https://github.com/lyushher/LeetCode-Python-Easy-DSA/blob/main/day-25/count_complete_tree_nodes.py)
228+
-[Leaf-Similar Trees](https://github.com/lyushher/LeetCode-Python-Easy-DSA/blob/main/day-25/leaf_similar_trees.py)
229+
230+
**Notes:** Counted nodes in a complete binary tree without traversing every node by comparing left/right subtree heights; when heights match, the left subtree is a perfect tree contributing 2^h − 1 nodes and we recurse on the right, otherwise the right is perfect and we recurse on the left—yielding an efficient divide-and-conquer solution with O((log n)2) time and O(log n) space. Then verified leaf similarity of two trees by performing DFS to extract the left-to-right leaf sequences and comparing them for equality, emphasizing order and values while ignoring internal structure; this runs in O(n + m) time with O(h1 + h2) stack usage.
231+
232+
---
233+
234+
## 📅 Day 26 – Array Manipulation & Missing Numbers
235+
-[Move Zeroes](https://github.com/lyushher/LeetCode-Python-Easy-DSA/blob/main/day-26/move_zeroes.py)
236+
-[Find All Numbers Disappeared in an Array](https://github.com/lyushher/LeetCode-Python-Easy-DSA/blob/main/day-26/find_all_numbers_disappeared_in_an_array.py)
237+
238+
**Notes:** Focused on in-place array manipulation techniques. In the first problem, efficiently pushed all zeroes to the end while preserving the order of non-zero elements using a two-pointer approach that overwrites non-zero values forward and fills the rest with zeros, achieving O(n) time and O(1) space. In the second, identified all missing numbers in the range [1, n] by marking visited indices via sign flipping, then collecting positions that remained positive as the missing values. Both problems reinforced the use of index-based logic and in-place modifications to optimize space while keeping solutions linear in time.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /