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
"Find the Weak Connected Component in the Directed Graph",
"Graph Valid Tree",
]
},
"Graph" : {
"nickname": "",
"property" : [
"x",
],
"problems" : [
"x",
]
},
"Binary tree" : {
"nickname": "二叉树",
"property" : [
"recursive, left, right",
"Binary Tree pre,in,post Traversal 都用到: DFS, Stack; divide && conquer(注意里面是return rst, 要懂得addAll); recursive with helper"
"Preorder Traversal: 1. Divide and conquer; 2. 1 stack: streo curr.val; push right, push left; 3. recursive with helper",
"Postorder Traversal: 1. Divide left&&right, conquer (add left, right, curr) 2. Two Stack(巧妙的s1,s2关系),最后output s2. 3. recursive with helper function",
"Inorder Traversal: 1. Divide and conquer; 2. 1 Stack: move all the way to left-down; add curr; move to right and push right; 3. Recursive with helper",
"Level Order Traversal: 1. Use queue, do bfs. 2. dfs: track with level number: each level add a new [] list in rst"
],
"problems" : [
"Binary Tree Paths",
"Binary Tree Preorder Traversal",
"Binary Tree Postorder Traversal",
"Binary Tree Inorder Traversal",
"Maximum Depth of Binary Tree",
"Convert Binary Search Tree to Doubly Linked List"
]
},
"Linked List" : {
"nickname": "",
"property" : [
"Singly linked list",
"slow/fast快慢指针"
],
"problems" : [
"Reverse LinkedList",
"Nth to last Node in List",
"Convert Sorted List to Binary Search Tree",
"Copy List with Random Pointer",
"Linked List Cycle"
]
},
"Binary Search" : {
"nickname": "",
"property" : [
"start + 1 < end",
"mid = start + (end - start)",
"不同的题目,match的condition可能会不太一样"
],
"problems" : [
"Search for a Range",
"Search Insert Position",
"Search in Rotated Sorted Array",
"Search a 2D Matrix",
"First Bad Version",
"Find Peak Element",
""
]
},
"Rotate" : {
"nickname": "翻转",
"property" : [
"中间截开一段,放在前面",
"常常需要分段翻转几回,做一个reverse function"
],
"problems" : [
"Reverse Words in a string",
"Rotated String",
"Recover Sorted Array"
]
},
"Trie" : {
"nickname": "Just a Tree",
"property" : [
"HashMap, store word, search word"
],
"problems" : [
"Implement Trie",
"Add and Search Word",
"Word Search II",
]
},
"Segment Tree" : {
"nickname": "线段树",
"property" : [
"Split by (start + end)/2. Make left,right child, then bind back to root",
"which of these intervals contain a given point",
"which of these points are in a given interval"
],
"problems" : [
"Segment Tree Query",
"Segment Tree Modify",
"Segment Tree Build",
"Interval Sum",
"Interval Minimum Number",
"Count of Smaller Number",
"Count of Smaller Number before itself",
]
},
"Expression Tree" : {
"nickname": "",
"property" : [
"Need to remember how to build the tree just like Max-tree using stack. 'while' add stack.pop() to node.left; if stack !empty, stack.peek().right = node; add node into stack",
],
"problems" : [
"Expression Evaludation",
]
},
"Toposort" : {
"nickname": "Topological Sort",
"property" : [
"NO CYCLE: Only possible if the graph has no directed cycle.",
"Must have a Sink vertex, the most outgoing vertex, where it all ends",