上一页 1 ··· 63 64 65 66 67 68 69 70 71 ··· 79 下一页
摘要: Binary Indexed Tree的作用 Binary Indexed Tree(BIT)现多用于高效计算数列的前序和,区间和。它可以在O(logn)的时间得到任意的前序和(prefix sum)。如一个array[2,5,-1,3,6],要计算第2个元素到第4个元素的和:5+-1+3=7。 B 阅读全文
posted @ 2020-03-10 00:24 johnny_zhao 阅读(221) 评论(0) 推荐(0) 编辑
摘要: package LeetCode_1356 import java.util.* /** * 1356. Sort Integers by The Number of 1 Bits * https://leetcode.com/problems/sort-integers-by-the-number 阅读全文
posted @ 2020-03-08 02:03 johnny_zhao 阅读(435) 评论(0) 推荐(0) 编辑
摘要: package LeetCode_190 /** * 190. Reverse Bits * https://leetcode.com/problems/reverse-bits/description/ * Reverse bits of a given 32 bits unsigned inte 阅读全文
posted @ 2020-03-08 00:25 johnny_zhao 阅读(107) 评论(0) 推荐(0) 编辑
摘要: /** * 3. Longest Substring Without Repeating Characters * https://leetcode.com/problems/longest-substring-without-repeating-characters/description/ * 阅读全文
posted @ 2020-03-07 16:23 johnny_zhao 阅读(135) 评论(0) 推荐(0) 编辑
摘要: /** * 989. Add to Array-Form of Integer * https://leetcode.com/problems/add-to-array-form-of-integer/description/ * For a non-negative integer X, the 阅读全文
posted @ 2020-03-06 01:13 johnny_zhao 阅读(97) 评论(0) 推荐(0) 编辑
摘要: /** * 896. Monotonic Array * https://leetcode.com/problems/monotonic-array/description/ * */ class Solution { fun isMonotonic(A: IntArray): Boolean { 阅读全文
posted @ 2020-03-05 01:25 johnny_zhao 阅读(85) 评论(0) 推荐(0) 编辑
摘要: package LeetCode_253 import LeetCode_252.Interval import java.util.Arrays /** * 253. Meeting Rooms II * (Lock by Leetcode) * https://www.lintcode.com/ 阅读全文
posted @ 2020-03-04 00:30 johnny_zhao 阅读(191) 评论(0) 推荐(0) 编辑
摘要: /** * 461. Hamming Distance * https://leetcode.com/problems/hamming-distance/description/ * The Hamming distance between two integers is the number of 阅读全文
posted @ 2020-03-03 01:58 johnny_zhao 阅读(95) 评论(0) 推荐(0) 编辑
摘要: import java.util.Arrays /** * 252. Meeting Rooms * (Locked by Leetcode) * https://www.lintcode.com/problem/meeting-rooms/description * Given an array 阅读全文
posted @ 2020-02-29 23:30 johnny_zhao 阅读(131) 评论(0) 推荐(0) 编辑
摘要: import kotlin.collections.HashMap /** * 146. LRU Cache * https://leetcode.com/problems/lru-cache/description/ * * 我们需要设计: * 1:使用HashMap:用于存储现有的key,val 阅读全文
posted @ 2020-02-29 16:33 johnny_zhao 阅读(119) 评论(0) 推荐(0) 编辑
上一页 1 ··· 63 64 65 66 67 68 69 70 71 ··· 79 下一页