上一页 1 ··· 3 4 5 6 7

2018年12月27日

Leetcode 140. Word Break II

摘要: Problem: Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, add spaces in s to construct a sentence where each 阅读全文

posted @ 2018-12-27 15:04 周浩炜 阅读(150) 评论(0) 推荐(0) 编辑

Leetcode 887. Super Egg Drop

摘要: Problem: You are given K eggs, and you have access to a building with N floors from 1 to N. Each egg is identical in function, and if an egg breaks, y 阅读全文

posted @ 2018-12-27 07:22 周浩炜 阅读(448) 评论(0) 推荐(0) 编辑

Leetcode 305. Number of Islands II

摘要: Problem: A 2d grid map of m rows and n columns is initially filled with water. We may perform an addLand operation which turns the water at position ( 阅读全文

posted @ 2018-12-27 05:38 周浩炜 阅读(142) 评论(0) 推荐(0) 编辑

2018年12月26日

Union Find算法总结

摘要: 基本思想: Union Find问题主要用于解决分块问题,对于Union Find问题一般也可以用DFS或BFS解决,但用Union Find更方便一些。该算法一般包含两个函数,Union和Find函数,Find函数就是依据图或树的拓扑关系找到其根节点,Union则是将两个子图或子树合并成一个树。 阅读全文

posted @ 2018-12-26 15:10 周浩炜 阅读(408) 评论(0) 推荐(0) 编辑

Leetcode 269. Alien Dictionary

摘要: Problem: There is a new alien language which uses the latin alphabet. However, the order among letters are unknown to you. You receive a list of non-e 阅读全文

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

上一页 1 ··· 3 4 5 6 7

导航