BÀI VIẾT
Ghi chép về xây dựng và vận hành hệ thống
Bài kỹ thuật — kiến trúc, bảo mật, và đôi khi là chuyện chiến trường.
#two-pass · Tất cả bài viết
Series
Thẻ
- #leetcode 50
- #dfs 17
- #recursion 16
- #bfs 10
- #trees 10
- #two-pointers 9
- #linked-list 8
- #backtracking 7
- #graphs 7
- #array 6
- #hash-map 6
- #heap-priority-queue 6
- #design 5
- #dynamic-programming 5
- #matrix 5
- #stack 5
- #cycle-detection 4
- #greedy 4
- #binary-search 3
- #binary-search-tree 3
- #binary-tree 3
- #divide-and-conquer 3
- #hard 3
- #monotonic-stack 3
- #sorting 3
- #string 3
- #arrays 2
- #data-stream 2
- #data-structures 2
- #dp 2
- #hash-table 2
- #in-place 2
- #math 2
- #priority-queue 2
- #simulation 2
- #sliding-window 2
- #topological-sort 2
- #arrays-hashing 1
- #bit-manipulation 1
- #combinatorics 1
- #constraint-satisfaction 1
- #constraint-validation 1
- #counting 1
- #depth-first-search 1
- #dummy-node 1
- #feasibility 1
- #flood-fill 1
- #gap-technique 1
- #geometry 1
- #hash-set 1
- #heap 1
- #kadane 1
- #level-order 1
- #memoization 1
- #monotonic 1
- #monotonic-deque 1
- #next-greater-element 1
- #optimization 1
- #palindrome 1
- #post-order 1
- #queue 1
- #quickselect 1
- #strings 1
- #two-pass 1
- #two-stacks 1
- #union-find 1
01
Copy List with Random Pointer: khi con trỏ next chưa đủ
Deep copy một linked list có random pointer trông đơn giản — cho đến khi bạn nhận ra random có thể trỏ ngược lại node chưa được clone. Hai cách giải: hash map đổi O(n) bộ nhớ để đổi lấy sự rõ ràng, và kỹ thuật interweaving gập bản sao vào trong danh sách gốc để đạt O(1) auxiliary space.14 thg 6, 2026 · 14 phút đọc · #00067
Đôi dòng ghi chép về những gì tôi đang xây
Nhận email khi tôi đăng bài mới — các bài kỹ thuật, không spam. Hủy đăng ký bất cứ lúc nào.