自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(51)
  • 资源 (6)
  • 收藏
  • 关注

原创 leetcode 日经贴,Cpp code -The Skyline Problem

The Skyline Problemclass Solution {public: vector> getSkyline(vector>& buildings) { vector > vertical_lines; for (int i = 0; i < buildings.size(); ++i) { vector &b

2015-05-26 11:42:43 471

原创 leetcode 日经贴,Cpp code -Contains Duplicate

Contains Duplicateclass Solution {public: bool containsDuplicate(vector& nums) { unordered_set us; for (int i = 0; i < nums.size(); ++i) { if (us.find(nums[i]) !=

2015-05-26 11:07:47 319

原创 leetcode 日经贴,Cpp code -Minimum Window Substring

Minimum Window Substringclass Solution {public: string minWindow(string s, string t) { vector count(256); int st = -1, ed = s.length(), distinct = 0; for (int i = 0; i

2015-05-24 17:21:35 500

原创 leetcode 日经贴,Cpp code -Combination Sum III

Combination Sum IIIclass Solution {public: void dfs(int current, int sum, vector &cans, vector >&ans, int k) { if (sum == 0 && cans.size() == k) { ans.push_back(cans);

2015-05-24 14:14:37 450 1

原创 leetcode 日经贴,Cpp code -Shortest Palindrome

Shortest Palindromeclass Solution {public: bool isPalindrome(const string &s, int st, int ed) { while (st < ed) { if (s[st] != s[ed]) { return false;

2015-05-24 14:04:33 306

原创 leetcode 日经贴,Cpp code -House Robber II

House Robber IIclass Solution {public: int roblinear(int *ary, int n) { int a = 0, b = 0; for (int i = 0; i < n; ++i) { int c = max(a, b); a = b + ary[

2015-05-20 10:26:12 434

原创 leetcode 日经贴,Cpp code -Add and Search Word - Data structure design

Add and Search Word - Data structure designstruct Trie { bool end; Trie *next[26]; Trie() { end = false; memset(next, 0, sizeof(next)); }};class WordDictionary {

2015-05-19 13:00:59 429

转载 Longest common subsequence

https://www.ics.uci.edu/~eppstein/161/960229.htmlICS 161: Design and Analysis of AlgorithmsLecture notes for February 29, 1996Longest Common SubsequencesIn this lecture we examine

2015-05-18 10:39:53 1810

原创 mod_python

install:./configure --with-apxs=/Applications/XAMPP/bin/apxs --with-flex=/Applications/XAMPP/bin/flexmakesudo make install

2015-05-14 17:11:35 472

原创 leetcode 日经贴,Cpp code -Multiply Strings

Multiply Stringsclass Solution {public: string multiplyPositive(string num1, string num2) { reverse(num1.begin(), num1.end()); reverse(num2.begin(), num2.end()); int n

2015-05-14 11:19:25 281

原创 leetcode 日经贴,Cpp code -First Missing Positive

First Missing Positiveclass Solution {public: int firstMissingPositive(vector& nums) { int n = nums.size(); for (int i = 0; i < n; ++i) { int v = nums[i];

2015-05-14 11:00:08 285

原创 leetcode 日经贴,Cpp code -Combination Sum

Combination Sumclass Solution {public: void dfs(const vector &candidates, vector > ¤t, int pos, int target, vector > &ans) { if (target == 0) { vector currentans;

2015-05-14 10:48:45 303

原创 leetcode 日经贴,Cpp code -Course Schedule II

Course Schedule IIclass Solution {public: vector findOrder(int numCourses, vector>& prerequisites) { vector inorder; vector > edge; inorder.resize(numCourses);

2015-05-14 10:38:44 315

原创 Some material form web for Understanding javascript

http://dmitrysoshnikov.com/ecmascript/javascript-the-core/JavaScript Module Pattern: In-Depth

2015-05-13 11:37:35 339

原创 leetcode 日经贴,Cpp code -Trapping Rain Water

Trapping Rain Waterclass Solution {public: int trap(vector& height) { int n = height.size(); stack >st; int maxh = 0, omit = 0; for (int i = 0; i < n; ++i) {

2015-05-12 17:21:18 345

原创 leetcode 日经贴,Cpp code -Count and Say

Count and Sayclass Solution {public: string a2i(int n) { if (!n) { return "0"; } string s; while (n) { s = char(n%10 + '0') + s;

2015-05-12 16:36:07 313

原创 leetcode 日经贴,Cpp code -Minimum Size Subarray Sum

Minimum Size Subarray Sumclass Solution {public: int minSubArrayLen(int s, vector& nums) { int n = nums.size(); int minlen = 0, p1 = 0, p2 = 0, sum = 0; while (p2 < n)

2015-05-12 16:29:50 380

原创 Programming Interview Questions 111: Design url shorten system

System Design for Big Data [tinyurl]How to code a URL shortener?

2015-05-11 18:31:59 408

原创 leetcode 日经贴,Cpp code -Sudoku Solver

Sudoku Solverclass Solution {public: int getValidMove(const vector >&board, int r, int c) { assert(board[r][c] == '.'); int s = 0; //row for (int j = 0; j < 9;

2015-05-11 17:17:46 386

原创 leetcode 日经贴,Cpp code -Valid Sudoku

Valid Sudokuclass Solution {public: bool validcell(vector &vi) { sort(vi.begin(), vi.end()); for (int i = 1; i < vi.size(); ++i) { if (vi[i] == vi[i - 1]) {

2015-05-11 16:55:22 294

原创 leetcode 日经贴,Cpp code -Search Insert Position

Search Insert Positionclass Solution {public: int searchInsert(vector& nums, int target) { int low = 0, high = nums.size(), mid = 0; while (low < high) { mid = (lo

2015-05-11 16:43:42 369

原创 Programming Interview Questions 9: Convert Array

Programming Interview Questions 9: Convert ArrayGiven an array [a1, a2, ..., aN, b1, b2, ..., bN, c1, c2, ..., cN]  convert it to [a1, b1, c1, a2, b2, c2, ..., aN, bN, cN] in-place using const

2015-05-08 16:44:46 382

原创 Programming Interview Questions 26: Trim Binary Search Tree

My Facebook interview question. Feb of 2015Programming Interview Questions 26: Trim Binary Search TreeO(n) complexityvoid remove(TreeNode *r) { if (!r) return; remove(r->left); remove(

2015-05-08 13:32:16 348

原创 leetcode 日经贴,Cpp code -Gray Code

Gray Codeclass Solution {public: vector grayCode(int n) { vector vi; vi.push_back(0); for (int i = 0; i < n; ++i) { int m = vi.size(); while (m

2015-05-08 11:00:00 308

原创 leetcode 日经贴,Cpp code -Subsets II

Subsets IIclass Solution {public: void gen(const vector &nums, int p, vector >&sets, vector &set) { int n = nums.size(); if (n == p) { sets.push_back(set);

2015-05-08 10:56:59 354

原创 leetcode 日经贴,Cpp code -Restore IP Addresses

Restore IP Addressesclass Solution {public: void gen(const string &s, int pos, int k, vector &ips, string &curstring) { int n = s.length(); if (k == 4) { if (n ==

2015-05-08 10:49:12 344

原创 leetcode 日经贴,Cpp code -Implement Trie (Prefix Tree)

Implement Trie (Prefix Tree)class TrieNode {private: TrieNode *next[26]; bool ed;public: // Initialize your data structure here. TrieNode() { memset(next, 0, sizeof(TrieN

2015-05-08 10:36:26 398

原创 silver trend

统计连续涨三天,那么在今后十天内最高能涨多少

2015-05-07 22:17:33 524

原创 interview question

http://www.ardendertat.com/2012/01/09/programming-interview-questions/http://www.ardendertat.com/2011/05/30/how-to-implement-a-search-engine-part-1-create-index/

2015-05-07 14:19:31 358

原创 leetcode 日经贴,Cpp code -Course Schedule

Course Scheduleclass Solution {public: bool canFinish(int numCourses, vector>& prerequisites) { vector inorder(numCourses); vector edge[numCourses]; for (int i = 0; i

2015-05-07 10:57:19 480 2

原创 leetcode 日经贴,Cpp code -Convert Sorted Array to Binary Search Tree

Convert Sorted Array to Binary Search Tree/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val

2015-05-07 10:50:32 296

原创 leetcode 日经贴,Cpp code -Construct Binary Tree from Inorder and Postorder Traversal

Construct Binary Tree from Inorder and Postorder Traversal/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * Tre

2015-05-07 10:45:03 301

原创 leetcode 日经贴,Cpp code -Construct Binary Tree from Preorder and Inorder Traversal

Construct Binary Tree from Preorder and Inorder Traversal/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * Tree

2015-05-07 10:39:27 404

原创 leetcode 日经贴,Cpp code -Merge Sorted Array

Merge Sorted Arrayclass Solution {public: void merge(vector& nums1, int m, vector& nums2, int n) { nums1.resize(n + m); int i = m - 1, j = n - 1, k = n + m - 1; while

2015-05-07 10:30:28 352

原创 leetcode 日经贴,Cpp code -Permutation Sequence

Permutation Sequenceclass Solution {public: string getPermutation(int n, int k) { string s = ""; vector fact; fact.resize(n + 1); fact[0] = 1; for (int

2015-05-06 15:01:16 322

原创 leetcode 日经贴,Cpp code -Permutations

Permutationsclass Solution {public: bool next_permutation(vector &nums) { int n = nums.size(); if (n <= 1) { return false; } int ed = n - 1;

2015-05-06 14:44:10 285

原创 leetcode 日经贴,Cpp code -Permutations II

Permutations IIclass Solution {public: bool next_permutation(vector &nums) { int n = nums.size(); if (n <= 1) { return false; } int ed = n - 1;

2015-05-06 14:43:52 294

原创 leetcode 日经贴,Cpp code -Plus One

Plus Oneclass Solution {public: vector plusOne(vector& digits) { vector ret = digits; reverse(ret.begin(), ret.end()); ret[0] += 1; int carry = 0; for

2015-05-06 12:51:45 277

原创 leetcode 日经贴,Cpp code -Pow(x, n)

Pow(x, n)class Solution {public: double myPow(double x, int n) { if (n == 0) { return 1.0; } bool neg = n < 0; long long ln = n; if (ln < 0

2015-05-06 12:48:39 263

原创 leetcode 日经贴,Cpp code -Binary Tree Level Order Traversal II

Binary Tree Level Order Traversal II/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), l

2015-05-05 18:56:21 323

pattern recognition and machine learning

bishop 的经典之作,学机器学习的首先,贝叶斯观点来解读模型

2011-10-08

带权区间图的最短路算法

提出一个带权区间图的最短路问题的O(n*a(n))的时间的新算法,其中n是带树区间图的个数

2009-09-05

简单的表达式求值 支持括号

简易计算器,能够实现对整数表达式进行以下运算, +、-、*、/、%、^并支持‘(’、‘)’。例如:((12-2)*6)/5

2009-09-04

dancing links

中文版的 dancing links,若想快点看懂就下吧,若想看原版就去找 knuth 的原版吧

2009-08-12

组合数学 组合数 整数划分 递推 方程 多项式定理

讲解组合数学的知识,大连理工应用数学系讲义 对学习组数学的朋友有很大的帮助 第二章 多项式定理及其应用

2009-08-03

RealPlayer11GOLD.deb

RealPlayer11GOLD.deb

2008-12-10

空空如也

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

TA关注的人

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