stary_yan的博客

数据爱好者。

[Leetcode] Union Find

[Leetcode] Union FindThis week, I will solve two problems in the section union find. As we all known, union find is a kind of useful algorithm to fin...

2017-12-23 19:07:24

阅读数:105

评论数:0

[Leetcode] Binary Index Tree

[Leetcode] Binary Index TreeIn this article we will discuss the Binary Indexed Trees structure. According to Peter M. Fenwick, this structure was fir...

2017-12-14 12:49:20

阅读数:113

评论数:0

[Leetcode]Graph & Union Find

Graph & Union FindThis time, I will talk about how to use union find to evaluate if there is a cycle in the graph. Union find is a useful method ...

2017-12-07 11:05:15

阅读数:103

评论数:0

[Leetcode]Dynamic Programming

[Leetcode]Dynamic ProgrammingRegular Expression MatchingAnalysisIt is easy to understand the problem. What we need to do is to find if the string can...

2017-12-02 12:44:34

阅读数:79

评论数:0

[Leetcode] Breadth-first Search

[Leetcode] Breadth-first SearchDescriptionAnalysisIt is easy to understand the question. To be simple, we just need to reach the position in the grap...

2017-11-23 13:10:00

阅读数:92

评论数:0

[Leetcode]Dynamic Programming

Dynamic Programming174. Dungeon GameDungeon GameAt first, I wanna use DFS to search all of the possible states, but I finally find that it will takes...

2017-11-16 11:03:51

阅读数:92

评论数:0

[Leetcode]Dynamic Programming

Dynamic ProgrammingIn this blog, I will solve two problem in leetcode to introduce an important idea in dynamic programming. As we all know, dynamic ...

2017-11-11 12:29:31

阅读数:107

评论数:0

[Leetcode] Math & Dynamic

[Leetcode] Math & DynamicIn this blog, I try to explain how to solve two similar question about Math & Dynamic. The idea in these two questio...

2017-11-04 10:17:01

阅读数:118

评论数:0

[Leetcode] Greedy

[Leetcode] Greedy502 IPODescriptionAnalysisThis problem can be easily described as we need to find the most profitable projects with the ability to a...

2017-10-26 15:15:40

阅读数:117

评论数:0

[Leetcode]Course Schedule

Course Schedule1Course ScheduleAccording to the problem description, it is easily to find that we need to use Topological Sort to solve with the prob...

2017-10-18 19:03:37

阅读数:117

评论数:0

[Leetcode] 211 & 208 Trie Tree

[Leetcode] 211 & 208 Trie TreeTrieIn computer science, a trie, also called digital tree and sometimes radix tree or prefix tree (on the ground th...

2017-10-12 11:08:01

阅读数:143

评论数:0

[Leetcode] 321.Create Maximum Number

[Leetcode] 321.Create Maximum Number[Description]321. Create Maximum Number[Analysis]To create max number of length k from two arrays, you need to cr...

2017-10-08 22:44:09

阅读数:116

评论数:0

[Leetcode]664. Strange Printer

[Leetcode]664. Strange PrinterDescription664. Strange PrinterAnalysis此题可以采取动态规划的想法。具体做法如下:时间复杂度:O( n^2 ), 空间复杂:O( n^2 )code#include <iostream> ...

2017-09-30 14:31:49

阅读数:397

评论数:0

[Leetcode] DFS

DFS576. Out of Boundary Paths576. Out of Boundary Pathsapproach-1 :Breadth-First-Search(TLE)I have no idea why this question will be categorized as D...

2017-09-24 20:34:36

阅读数:137

评论数:0

[Leetcode]Dynamic Programming

Dynamic Programming91. Decode Ways91. Decode Ways[Analysis]此题目考虑使用动态规划的思想。思路如下,假设已知一个字符串可以decode为N种不同的字符组合,那么此时再加入一个新的数字进入这个字符串中又能构成多少种不同的字符组合。这是动态规划...

2017-09-14 22:15:26

阅读数:262

评论数:0

[Leetcode]Dynamic Programming-note

Dynamic Programming338. Counting Bits[Desciption]Counting Bits[Analysis]method-1本题有非常简单的做法,就是可以直接对每个数单独计算其二进制下1的个数。 vector<int> countBits(in...

2017-09-10 17:13:29

阅读数:148

评论数:0

[数据结构与算法]详解动态规划

Ch15–动态规划动态规划原理适合动态规划的问题通常具有两个要素:最优子结构和子问题重叠。简单地说,就是要解决一个原问题,可以把该问题分解为很多的子问题,而子问题也可以同样地分割为其他的子问题。在这个时候如果我们使用暴力求解会导致效率低下,而且浪费资源。动态规划的想法就是把子问题的解放入一个表中,...

2016-12-01 18:21:58

阅读数:507

评论数:0

[C++]KMP算法匹配字符串

KMP算法匹配字符串题目描述如下: Time Limit: 1sec Memory Limit:32MB Description Brian is an enthusiast of computer games, especially those that simulate ...

2016-12-01 18:21:06

阅读数:281

评论数:0

初级实训经验总结

初级实训经验总结Agenda-gitHubCPP版本在上周完成了升大二前的初级实训。这次实训的主要内容为实现一个用C++写的会议管理系统。这个系统使用了MVC模式,以及文件读写从而实现数据永久化。这个实现版本在基于学长给的头文件代码来实现的,所以免去了设计MVC的麻烦,只是在实现业务逻辑的时候需要...

2016-09-03 00:29:40

阅读数:550

评论数:0

高质量代码的命名规则

代码中会出现大量的变量名,类名,函数名……低质量代码的命名通常会特别混乱而没有意义,这对以后的重构会导致很大的问题,所以运用高质量代码的命名规则可以极大地提升代码的清晰度和可读性。值得认真学习。此处分享一篇大神的文章。【《代码整洁之道》精读与演绎】之二 高质量代码的命名法则与各位朋友通过努力。

2016-08-17 23:28:24

阅读数:210

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭