[置顶] SQL Index

摘要: SQL Index 阅读全文

posted @ 2018-12-30 06:06 周浩炜 阅读(189) 评论(0) 推荐(0) 编辑

[置顶] Leetcode Index

摘要: 序: 用于记录刷题过程中难度较大或思路怪异的题目,对于常规难度一般的题就不写入我的博客了,关于效率仅是提交时击败的百分比,可能会随时间波动,仅供参考,算法优劣以时间复杂度和空间复杂度为基准。欢迎留言讨论。 阅读全文

posted @ 2018-12-29 14:26 周浩炜 阅读(251) 评论(0) 推荐(0) 编辑

2019年2月21日

Leetcode 961. N-Repeated Element in Size 2N Array

摘要: Problem: In a array A of size 2N, there are N+1 unique elements, and exactly one of these elements is repeated N times. Return the element repeated N 阅读全文

posted @ 2019-02-21 14:15 周浩炜 阅读(250) 评论(0) 推荐(0) 编辑

2019年2月18日

MIT-6.824 lab1

摘要: github:https://github.com/haoweiz/MIT-6.824 Part1: 第一部分比较简单,我们只需要修改doMap和doReduce函数即可,主要涉及Go语言对Json文件的读写。简单说说part1的测试流程吧,Sequential部分代码如下 makeInputs(M 阅读全文

posted @ 2019-02-18 13:10 周浩炜 阅读(4491) 评论(0) 推荐(0) 编辑

2019年2月17日

Leetcode 955. Delete Columns to Make Sorted II

摘要: Problem: We are given an array A of N lowercase letter strings, all of the same length. Now, we may choose any set of deletion indices, and for each s 阅读全文

posted @ 2019-02-17 04:11 周浩炜 阅读(193) 评论(0) 推荐(0) 编辑

2019年2月10日

Leetcode 793. Preimage Size of Factorial Zeroes Function

摘要: Problem: Let f(x) be the number of zeroes at the end of x!. (Recall that x! = 1 * 2 * 3 * ... * x, and by convention, 0! = 1.) For example, f(3) = 0 b 阅读全文

posted @ 2019-02-10 13:45 周浩炜 阅读(267) 评论(0) 推荐(0) 编辑

Leetcode 798. Smallest Rotation with Highest Score

摘要: Problem: Given an array A, we may rotate it by a non-negative integer K so that the array becomes A[K], A[K+1], A{K+2], ... A[A.length - 1], A[0], A[1 阅读全文

posted @ 2019-02-10 06:16 周浩炜 阅读(131) 评论(0) 推荐(0) 编辑

2019年2月8日

Leetcode 480. Sliding Window Median

摘要: Problem: Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean o 阅读全文

posted @ 2019-02-08 15:50 周浩炜 阅读(286) 评论(0) 推荐(0) 编辑

2019年1月26日

Leetcode 827. Making A Large Island

摘要: Problem: In a 2D grid of 0s and 1s, we change at most one 0 to a 1. After, what is the size of the largest island? (An island is a 4-directionally con 阅读全文

posted @ 2019-01-26 05:14 周浩炜 阅读(273) 评论(0) 推荐(0) 编辑

2019年1月17日

Leetcode 855. Exam Room

摘要: Problem: In an exam room, there are N seats in a single row, numbered 0, 1, 2, ..., N-1. When a student enters the room, they must sit in the seat tha 阅读全文

posted @ 2019-01-17 16:55 周浩炜 阅读(252) 评论(0) 推荐(0) 编辑

2019年1月16日

Leetcode 803. Bricks Falling When Hit

摘要: Problem: We have a grid of 1s and 0s; the 1s in a cell represent bricks. A brick will not drop if and only if it is directly connected to the top of t 阅读全文

posted @ 2019-01-16 16:01 周浩炜 阅读(255) 评论(0) 推荐(0) 编辑

区间最值查询问题

摘要: 基本思想: 该问题要求我们以较低的时间复杂度查询一段区间中的最值。最暴力的解法是将所有可能的区间序列化作为一个哈希表的键进行存储,值为区间内的最值,这样预处理的时间复杂度为O(n2),查询时间复杂度为O(1)。但这样不适用于对数组元素进行更新的操作,和getRangeSum的问题一样,这样子它的更新 阅读全文

posted @ 2019-01-16 04:59 周浩炜 阅读(526) 评论(0) 推荐(0) 编辑

导航