1、鏈表
雙指針:首尾指針、快慢指針
2、數組
3、字符串
子串問題:前綴和
4、隊列
5、棧
難點:多次入棧和出棧操作,影響內容的順序
6、哈希表
7、二叉樹
8、排序
9、搜索
10、動態規劃
1、鏈表
雙指針:首尾指針、快慢指針
2、數組
3、字符串
子串問題:前綴和
4、隊列
5、棧
難點:多次入棧和出棧操作,影響內容的順序
6、哈希表
7、二叉樹
8、排序
9、搜索
10、動態規劃
面試題62. 圓圈中最後剩下的數字 class Solution { public int lastRemaining(int n, int m) { // 模擬法 List<Integer> l
1. 兩數之和 暴力: class Solution { public int[] twoSum(int[] nums, int target) { int[] res = new int[2];
01.07. 旋轉矩陣 簡單粗暴: class Solution { public void rotate(int[][] matrix) { int size = matrix.length;
11. 盛最多水的容器 暴力... class Solution { public int maxArea(int[] height) { int max = 0; for (int i
7. 整數反轉 class Solution { public int reverse(int x) { long result = 0; while (x != 0) { // 如果是-1
208. 實現 Trie (前綴樹) class Trie { //定義節點 class TrieNode { boolean isEnd; TrieNode[] next = new
912. 排序數組 class Solution { public int[] sortArray(int[] nums) { quickSort(nums, 0, nums.length - 1);