自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Leader的专栏

这是一位Leader的博客

  • 博客(25)
  • 资源 (2)
  • 收藏
  • 关注

转载 Largest Number

class Solution {public: string largestNumber(vector& nums) { string m_res = ""; if (nums.size() < 1) return m_res; sort(nums.begin(),nums.end(),compare);

2015-06-30 14:14:42 269

原创 Python 多线程分块读文件

这里参考了这篇文章 https://gist.github.com/friskfly/4412375 ,然后加上自己的理解和应用, 整理如下: # -*- coding: utf-8 -*-import os,timeimport threadingimport ConfigParserrlock = threading.RLock()curPosition = 0cl

2015-06-30 10:35:42 2784 3

原创 Binary Tree Preorder Traversal

/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */clas

2015-06-24 16:48:33 426

原创 Evaluate Reverse Polish Notation

class Solution {public: int evalRPN(vector& tokens) { if(tokens.empty()) return 0; stack s; int res=0; const int n=tokens.size(); for(int

2015-06-24 16:37:05 224

原创 Intersection of Two Linked Lists

/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListNode *ge

2015-06-24 16:06:34 246

转载 Minimum Window Substring

class Solution {public: string minWindow(string S, string T) { if (S.empty() || T.empty()) { return ""; } int count = T.size(); int require[128

2015-06-19 11:32:49 294

转载 Anagrams

class Solution {public: vector anagrams(vector& strs) { map m; vector res; if(strs.empty()) return res; const int n=strs.size();

2015-06-16 23:22:58 280

转载 Reverse Words in a String

class Solution {public: void reverseWords(string &s) { string res=""; int i=0; const int n=s.size(); while(true) { while(i<n && s[i]==' ')

2015-06-16 23:19:56 268

转载 Spiral Matrix

class Solution {public: vector spiralOrder(vector>& matrix) { vector res; if(matrix.empty()||matrix[0].empty()) return res; int m=matrix.

2015-06-16 11:16:37 238

转载 Find Peak Element

class Solution {public: int findPeakElement(vector& nums) { int low=0; int high=nums.size()-1; while(low<high) { int mid=low+(high-low)/2;

2015-06-15 11:26:34 303

转载 Maximum Subarray

class Solution {public: int maxSubArray(vector& nums) { const int n=nums.size(); int maxSum=0; //每一段的最大值,局部最优 int result=INT_MIN; //全局最优 for(int i=0;i<

2015-06-09 12:53:13 233

原创 Search for a Range

class Solution {public: vector searchRange(vector& nums, int target) { const int n=nums.size(); vector res(2,-1); int start=0;int end=n-1; while(star

2015-06-09 12:52:03 297

转载 Reverse Nodes in k-Group

/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListNode* re

2015-06-04 16:13:45 271

转载 Container With Most Water

class Solution {public: int maxArea(vector& height) { const int n=height.size(); int leftWall=height[0]; int rightWall=height[n-1]; int left=0; int ri

2015-06-04 15:42:01 228

原创 Search a 2D Matrix

class Solution {public: bool searchMatrix(vector>& matrix, int target) { const int m=matrix.size(); const int n=matrix[0].size(); int i=0; int j=n-1;

2015-06-04 15:06:37 215

原创 Remove Nth Node From End of List

/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListNode* re

2015-06-04 14:57:31 302

转载 Max Points on a Line(转载,完全转载hackersun)

/** * Definition for a point. * struct Point { * int x; * int y; * Point() : x(0), y(0) {} * Point(int a, int b) : x(a), y(b) {} * }; */class Solution {public: int maxPoi

2015-06-03 11:21:14 223

转载 Reverse Linked List II

/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListNode* re

2015-06-02 14:58:56 248

转载 Reverse Linked List

/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListNode* re

2015-06-02 10:07:49 249

转载 Remove Duplicates from Sorted List II

/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListNode* de

2015-06-02 09:47:06 543

转载 Search in Rotated Sorted Array

class Solution {public: int search(vector& nums, int target) { int low=0; int high=nums.size()-1; while(low<=high) { int mid=low+(high-low)/2;

2015-06-01 23:27:42 256

转载 Search in Rotated Sorted Array II

class Solution {public: bool search(vector& nums, int target) { int low=0; int high=nums.size()-1; while(low<=high) { int mid=low+(high-low)/2;

2015-06-01 23:27:14 270

原创 Remove Duplicates from Sorted Array II

class Solution {public: int removeDuplicates(vector& nums) { const int n=nums.size(); if(0==n) return 0; int temp=nums[0]; int length=0; f

2015-06-01 19:42:29 213

原创 Remove Duplicates from Sorted Array

class Solution {public: int removeDuplicates(vector& nums) { if(nums.empty()) return 0; const int n=nums.size(); int length=0; int temp=nums[0];

2015-06-01 16:41:14 232

转载 Maximum Subarray

class Solution {public: int maxSubArray(vector& nums) { const int n=nums.size(); int MaxSum=nums[0]; int curMax=nums[0]; for(int i=1;i<n;++i) {

2015-06-01 16:13:50 208

docker从入门到精通-入门篇

docker入门教程。推荐新手下载,网上找的资源,很不错

2018-01-26

opencv控件

opencv的控件程序,vc++画图必备。

2013-04-28

空空如也

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

TA关注的人

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