H’s notes on Data Structuress and Algorithms
About
H’s notes on Data Structuress and Algorithms
Categories
All
(16)
Linked List
I create a dummy head first, modify everything after, and then return the actual head with
dummy.next
Jul 21, 2023
Pham Nguyen Hung
Sliding window
Sliding window at its core is processing the data in an array in chunk, with limits set by 2 pointers at both sides. Sliding window is particularly suitable if I need to…
Jul 21, 2023
Pham Nguyen Hung
Stack
A data structure with the trademark of…
Jul 21, 2023
Pham Nguyen Hung
Fast and slow pointers
This is not a data structure, but a pattern of coding interview questions. This is something passed down from languages with pointers such as C++ or Java. The idea is that I…
Jul 21, 2023
Pham Nguyen Hung
Tree
The upgraded version of a linked list.
Jul 21, 2023
Pham Nguyen Hung
Sorting
Firstly, See About page.
Jul 21, 2023
Pham Nguyen Hung
Heap
Heap, or priority queue, is a data structure that supports quick searching of the
prioritized
element such as the minimum or…
Jul 21, 2023
Pham Nguyen Hung
Two pointers
This is not a data structure, but a pattern of coding interview questions. This is something passed down from…
Jul 21, 2023
Pham Nguyen Hung
Graph
Graph is the generalization of linked list and tree.
Jul 21, 2023
Pham Nguyen Hung
Merge Intervals
Merge intervals is applicable to problems that entail overlapping intervals. Each…
Jul 21, 2023
Pham Nguyen Hung
Trie (Prefix Tree)
The first thing I think of is a linked list. Each node containing a character and a pointer to the next node. It was insufficient - I also need to know if the node is the…
Jul 21, 2023
Pham Nguyen Hung
Binary search
In a sorted array, there exists a faster way to search for a specific element than visiting each element. The intuition is if I find an element that is smaller than…
Jul 21, 2023
Pham Nguyen Hung
Backtracking
I found a video that gave 5 algorithms that are most frequently used in interview. The video agrees with AlgoMonster or Jiuzhang. BFS and DFS are still the most frequently used, followed by Dynamic Programming and Backtracking. The next one is the class of two pointer (oppposite direction, sliding…
Jul 21, 2023
Pham Nguyen Hung
Bit Manipulation
Time complexity:
Jul 21, 2023
Pham Nguyen Hung
Array & String
The easiest, linear data structure, consisting of elements stored in contiguous memory slots.…
Jul 21, 2023
Pham Nguyen Hung
Dynamic programming
A technique for solving complex problems by breaking them…
Jul 21, 2023
Pham Nguyen Hung
No matching items