随笔分类 -  九章高频

第一章
摘要:1 Strings Homomorphism public boolean isIsomorphic(String s, String t) { // write your code here char[] ss = s.toCharArray(); char[] tt = t.toCharArra 阅读全文
posted @ 2017-12-22 23:02 wheleetcode 阅读(141) 评论(0) 推荐(0)
数学、计算几何、位运算常见问题详解
摘要:• 矩阵上的问题(3题) Search a 2D Matrix II public int searchMatrix(int[][] matrix, int target) { // write your code here int n = matrix.length; if (n == 0) { 阅读全文
posted @ 2017-11-06 23:54 wheleetcode 阅读(417) 评论(0) 推荐(0)
搜索类题目的高效实现
摘要:BFS 类问题 1 Surrounded Regions public void surroundedRegions(char[][] board) { int n = board.length; if (n == 0) { return; } int m = board[0].length; fo 阅读全文
posted @ 2017-10-31 11:35 wheleetcode 阅读(362) 评论(0) 推荐(0)
基础算法和数据结构高频题 II
摘要:DFS的两种理解方式:1. 按照实际执行顺序模拟 (适合枚举型DFS,下节课内容)2. 按照DFS的定义宏观理解 (适合分治型DFS,本节课内容) 1 Convert BST to Greater Tree int sum = 0; public TreeNode convertBST(TreeNo 阅读全文
posted @ 2017-10-29 15:41 wheleetcode 阅读(337) 评论(0) 推荐(0)
第三章 基础算法和数据结构高频题 I
摘要:区间类问题 1 Missing Interval public List<String> findMissingRanges(int[] nums, int lower, int upper) { List<String> res = new ArrayList<>(); if (nums == n 阅读全文
posted @ 2017-10-24 12:10 wheleetcode 阅读(215) 评论(0) 推荐(0)
第二章 模拟算法和字符串处理技巧
摘要:1 Sliding Window Average from Data Stream public class MovingAvage { int id, size; double[] sum; public MovingAvage(int s) { size = s; sum = new doubl 阅读全文
posted @ 2017-10-22 15:15 wheleetcode 阅读(205) 评论(0) 推荐(0)