2019年1月6日

Leetcode 312. Burst Balloons

摘要: Problem: Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all th 阅读全文

posted @ 2019-01-06 05:38 周浩炜 阅读(168) 评论(0) 推荐(1) 编辑

2019年1月5日

Leetcode 773. Sliding Puzzle

摘要: Problem: On a 2x3 board, there are 5 tiles represented by the integers 1 through 5, and an empty square represented by 0. A move consists of choosing 阅读全文

posted @ 2019-01-05 17:11 周浩炜 阅读(157) 评论(0) 推荐(0) 编辑

Leetcode 765. Couples Holding Hands

摘要: Problem: N couples sit in 2N seats arranged in a row and want to hold hands. We want to know the minimum number of swaps so that every couple is sitti 阅读全文

posted @ 2019-01-05 15:07 周浩炜 阅读(225) 评论(0) 推荐(0) 编辑

2019年1月3日

Pintos Project 1

摘要: 序: 这是我第二次写Pintos内核,第一次上这课的时候由于刚接触操作系统,这个project难度又是非常大,所以其实写出的代码有很多bug,一些测试也没有通过,希望通过这次重写Pintos,加深对操作系统内核的理解,并力争通过所有测试。代码完整部分在我的github里,如果觉得有帮助的话记得sta 阅读全文

posted @ 2019-01-03 14:59 周浩炜 阅读(7400) 评论(0) 推荐(3) 编辑

2019年1月2日

Fenwick树状数组

摘要: 基本思想: 树状数组是用来解决在数组元素动态变化的情况下,高效的计算子数组和的一种数据结构,其更新效率和计算和的效率均为O(logn),和普通的sum数组不同的是,虽然sum数组计算子数组和的效率为O(1),但是在面对数组元素动态变化的情况下,其更新效率为O(n)。Fenwick数组的更新方式如下图 阅读全文

posted @ 2019-01-02 23:04 周浩炜 阅读(1670) 评论(0) 推荐(0) 编辑

Trie算法总结

摘要: 基本思想: 对于Trie类的题目,如果题目要求对多个字符串同时进行处理且有和DFS/BFS结合(这一般是hard题的难度),或者和前缀有关的操作,就应该要考虑到使用Trie的可能性。如果说常规DFS/BFS对字符串处理的解法效率不能达到目标,但又不至于超时,很大可能性就会使用Trie这种数据结构,具 阅读全文

posted @ 2019-01-02 18:22 周浩炜 阅读(299) 评论(0) 推荐(0) 编辑

2019年1月1日

Leetcode 425. Word Squares

摘要: Problem: Given a set of words (without duplicates), find all word squares you can build from them. A sequence of words forms a valid word square if th 阅读全文

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

Leetcode 212. Word Search II

摘要: Problem: Given a 2D board and a list of words from the dictionary, find all words in the board. Each word must be constructed from letters of sequenti 阅读全文

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

2018年12月31日

Leetcode 843. Guess the Word

摘要: Problem: This problem is an interactive problem new to the LeetCode platform. We are given a word list of unique words, each word is 6 letters long, a 阅读全文

posted @ 2018-12-31 17:12 周浩炜 阅读(523) 评论(0) 推荐(0) 编辑

Leetcode 410. Split Array Largest Sum

摘要: Problem: Given an array which consists of non-negative integers and an integer m, you can split the array into m non-empty continuous subarrays. Write 阅读全文

posted @ 2018-12-31 09:37 周浩炜 阅读(204) 评论(0) 推荐(0) 编辑

导航