自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(17)
  • 资源 (5)
  • 收藏
  • 关注

原创 LintCode Linked List专辑

1. Reverse Linked List2. Remove Duplicates from Sorted List3. Remove Duplicates from Sorted List II4. Reverse Linked List II5. Majority Number III6. Partition List7.1. Reverse Li...

2018-05-05 22:31:16 321

原创 LintCode二分查找专辑

1. First Position of Targetclass Solution {public: /** * @param nums: The integer array. * @param target: Target to find. * @return: The first position of target. Position star...

2018-04-13 21:37:00 253

原创 枚举/组合

subsets descriptionclass Solution {public: /** * @param nums: A set of numbers * @return: A list of lists */ vector<vector<int>> subsets(vector<int> &a...

2018-04-07 12:33:23 265

原创 [DP] LeetCode Regular Expression Matching

algorithm procedureif the current text character is matching with the pattern character, which means the last character matched, then the result depends on the previous status: res(r,c)=res(r−1,c−1

2018-01-04 23:00:44 165

原创 LeetCode 2Sum, 3Sum, 4Sum

two sum problemthree accepted solutions are provided here with decreased time complexity.class Solution {public: vector<int> twoSum(vector<int>& nums, int target) { vector<int> res;#if 0

2018-01-03 22:29:41 176

原创 LeetCode 8-9 Solutions

8. String to Integer(atoi)class Solution {public: bool isDigit(char c) { return c >= '0' and c <='9'; } int myAtoi(string str) { size_t idx = 0; size_t len = str.length();

2018-01-01 21:55:12 172

原创 [DP] Hackerank The Coin Change Problem

You can find the problem description here, Sample Input 110 42 5 3 6Sample Output 15This is a typical knapsack problem with repetitions which can be easily solved by making a transaction table from to

2017-12-31 11:58:34 346

原创 Dynamic Programming part 1 -- Knapsack Problem

This article is adapted from this pdf.During a robbery, a burglar finds much more loot than he had expected and has to decide what to take. His bag (or “knapsack”) will hold a total weight of at most

2017-12-30 12:09:20 452

原创 [DP] LeetCode 5 Longest Palindromic Substring

O(N2)O(N^2) codeclass Solution {public: string longestPalindrome(string str) { int size = str.length(); int ps = 0, maxLen = 1; vector<vector<bool>> isP(size, vector<bool>(

2017-12-30 10:36:17 136

原创 [DP] Leetcode 300 Longest Increasing Subsequence

O(N2)O(N^2) codeclass Solution {public: int lengthOfLIS(vector<int>& seq) { if (seq.empty()) return 0; // lens indicate the sequence END by element t vector<int> lens(seq.s

2017-12-30 10:24:38 225

原创 1.3.1 FatMouse trade

WA:#include#include#includeusing namespace std;class Node {public: double ratio, mount,value; Node(double r,double m,double v){ ratio=r; mount=m; value=v; } bool operator>(const

2013-04-02 22:38:47 630

原创 1.2.8 Lowest Bit

#include#include#includeusing namespace std;int main(int argc, char* argv[]){ int get, count; while(cin >> get) { if(get == 0) return 1; bitset bs(get); count = 0; int len = bs

2013-04-02 21:10:47 609

原创 1.2.7 GPA

#include#include#includeusing namespace std;#define max 1000int main(int argc, char* argv[]){ double result; int i; char line[max];l: while(cin.getline(line, max)) { int len = string(

2013-04-01 21:53:26 938

原创 Huffman树

要解决的问题是关于霍夫曼树的,题目在:http://acm.hdu.edu.cn/showproblem.php?pid=1053直接写代码吧,不得不说写得真的很复杂,调试了半天,出了好多错哈:#include#include#include#includeusing namespace std;const int R = 27; // A~Z, _cons

2013-01-18 15:40:27 648

原创 PQ使用

priority_queue默认用 priority。第一次代码比较复杂:pq.cpp#include#includeusing namespace std;class NODE { public: char ch; int freq; bool operator>(const NODE n1) const

2013-01-17 16:42:10 1763 1

原创 DFS走迷宫

BFS走出的是一条最短路径,DFS走出的不一定是最短路径。只要把前面的BFS代码稍作修改,改成递归的形式即可。BFS使用的队列的数据结构来存储中间结果,DFS使用的是栈,因此DFS使用递归的形式。#include#include#include#include#define MAXLEN 100int edge_to[MAXLEN];int maze[MAXLEN][MA

2013-01-04 14:05:35 949

原创 BFS走迷宫

简单的走迷宫的算法,BFS就是把当前的顶点的邻接顶点都入队列,然后队列首端出队列,重复,知道所有的通路,然后一个一个的往回找即可。#include#include#include#include#define MAXLEN 100int edge_to[MAXLEN];int maze[MAXLEN][MAXLEN];bool visited[MAXLEN][MAXLEN];

2013-01-04 10:52:49 841

python-3.3.3.amd64

64问系统能用的python安装包啦 希望有用对大家

2014-01-18

酒店点菜管理系统需求分析

很详细的点餐系统需求分析 希望对做这个项目的有点帮助

2014-01-18

点菜系统需求分析及数据流图

很详细的点餐系统需求分析 希望对做这个项目的有点帮助

2014-01-18

很好的发送串口接收程序

串口接收程序很好的啊 费 是否 ,啊沙发了可收到发货速度快了见附件三方的

2011-04-06

s3c44b0原理图

s3c44b0原理图,很有用的啊,用来设计等等

2011-03-06

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

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