自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(104)
  • 资源 (4)
  • 收藏
  • 关注

原创 102. Unique Paths II

-63. Unique Paths II My Submissions QuestionEditorial Solution Total Accepted: 67444 Total Submissions: 228395 Difficulty: Medium Follow up for “Unique Paths”:Now consider if some obstacles are added

2016-05-31 14:30:17 263

原创 101. Unique Paths

-62. Unique Paths My Submissions QuestionEditorial Solution Total Accepted: 89668 Total Submissions: 244895 Difficulty: Medium A robot is located at the top-left corner of a m x n grid (marked ‘Start

2016-05-31 12:47:12 232

原创 python绘制封闭多边形

数据格式:(polygon.txt) 里面含有2个多边形,一行是一个点 0.085, 0.834, 0.024, 0.744, 0, 0.63, 0.024, 0.516, 0.085, 0.427, 0.5, 0.02, 0.675, 0.191, 0.795, 0.071, 0.815, 0.052, 0.835, 0.032, 0.84, 0.026, 0.844, 0

2016-05-30 22:59:25 11874

转载 LSM-tree 一种高效的索引数据结构

LSM-tree 一种高效的索引数据结构  论文 The Log-Structure Merge-Tree(LSM-tree)(http://www.google.com.my/url?sa=t&rct=j&q=&esrc=s&source=web&cd=4&cad=rja&ved=0CDoQFjAD&url=http%3A%2F%2Fciteseerx.ist.psu

2016-05-30 20:48:31 563

转载 证明:log(n!)与nlogn是等价无穷大

证明:log(n!)与nlogn是等价无穷大 分类: Mathematics(6) (log的底大于1即可)1、首先由Stirling's formula:也就是分子、分母是等价无穷大(n->oo)。2、再来证明log(n!) 与 nlogn是等价无穷大(n->oo):挺不可

2016-05-29 12:26:36 8423 1

转载 经典算法和数据结构(一) 优先级队列与堆排序

优先级队列与堆排序在很多应用中,我们通常需要按照优先级情况对待处理对象进行处理,比如首先处理优先级最高的对象,然后处理次高的对象。最简单的一个例子就是,在手机上玩游戏的时候,如果有来电,那么系统应该优先处理打进来的电话。在这种情况下,我们的数据结构应该提供两个最基本的操作,一个是返回最高优先级对象,一个是添加新的对象。这种数据结构就是优先级队列(Priority Queue

2016-05-28 17:43:46 1528

转载 经典算法和数据结构(四) 平衡查找树之B树

浅谈算法和数据结构: 十 平衡查找树之B树前面讲解了平衡查找树中的2-3树以及其实现红黑树。2-3树种,一个节点最多有2个key,而红黑树则使用染色的方式来标识这两个key。维基百科对B树的定义为“在计算机科学中,B树(B-tree)是一种树状数据结构,它能够存储数据、对其进行排序并允许以O(log n)的时间复杂度运行进行查找、顺序读取、插入和删除的数据结构。B树,概括来

2016-05-28 12:35:59 426

转载 经典算法和数据结构(三): 平衡查找树之红黑树

浅谈算法和数据结构: 九 平衡查找树之红黑树前面一篇文章介绍了2-3查找树,可以看到,2-3查找树能保证在插入元素之后能保持树的平衡状态,最坏情况下即所有的子节点都是2-node,树的高度为lgN,从而保证了最坏情况下的时间复杂度。但是2-3树实现起来比较复杂,本文介绍一种简单实现2-3树的数据结构,即红黑树(Red-Black Tree)定义红黑树的主要是像是

2016-05-28 12:31:41 359

原创 100. Implement Queue using Stacks

-232. Implement Queue using Stacks My Submissions QuestionEditorial Solution Total Accepted: 44621 Total Submissions: 130935 Difficulty: Easy Implement the following operations of a queue using stack

2016-05-27 22:29:46 376

原创 99-Ugly Number II

-264. Ugly Number II Write a program to find the n-th ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 6, 8, 9, 10, 12 is the sequenc

2016-05-27 22:16:01 258

原创 98-Combination Sum II

-40. Combination Sum II My Submissions QuestionEditorial Solution Total Accepted: 69805 Total Submissions: 250937 Difficulty: Medium Given a collection of candidate numbers (C) and a target number (T

2016-05-27 20:53:36 244

原创 97-Combination Sum

-39. Combination Sum My Submissions QuestionEditorial Solution Total Accepted: 93154 Total Submissions: 298105 Difficulty: Medium Given a set of candidate numbers (C) and a target number (T), find al

2016-05-27 20:40:15 234

原创 96-Substring with Concatenation of All Words

-30. Substring with Concatenation of All Words My Submissions QuestionEditorial Solution Total Accepted: 55346 Total Submissions: 264413 Difficulty: Hard You are given a string, s, and a list of word

2016-05-27 19:57:58 281

转载 2016百度春季笔试

4.23 10:00更新,编程题1的Python实现,仅供参考。源码见页尾4.23 20:35更新,编程题2的Python实现。源码见尾页百度的题还是非常偏重算法的,整体来讲难度比较高,尤其是编程题,下面附上原题:选择题

2016-05-27 15:45:17 390

转载 BAT网易经典题

8月15日,百度2道面试题:1、来自《编程之美》的概率题:一个桶里面有白球、黑球各100个,现在按下述规则取球:的    i 、每次从通里面拿出来两个球;    ii、如果取出的是两个同色的求,就再放入一个黑球;    ii、如果取出的是两个异色的求,就再放入一个白球。问:最后桶里面只剩下一个黑球的概率是多少?2、算法题:给你一个自然数N,求[6,N]之内的所有素数中,两两

2016-05-27 15:34:32 18687

原创 95-Rectangle Area

-223. Rectangle Area My Submissions QuestionEditorial Solution Total Accepted: 37901 Total Submissions: 126073 Difficulty: Easy Find the total area covered by two rectilinear rectangles in a 2D plane

2016-05-27 14:05:36 286

原创 94. Bulls and Cows

-299. Bulls and Cows My Submissions QuestionEditorial Solution Total Accepted: 29884 Total Submissions: 99659 Difficulty: Easy You are playing the following Bulls and Cows game with your friend: You

2016-05-27 13:20:02 234

原创 93. Number of 1 Bits

-191. Number of 1 Bits My Submissions QuestionEditorial Solution Total Accepted: 93052 Total Submissions: 247813 Difficulty: Easy Write a function that takes an unsigned integer and returns the numbe

2016-05-27 12:48:53 222

原创 92-Integer Break

-343. Integer Break My Submissions QuestionEditorial Solution Total Accepted: 11616 Total Submissions: 28637 Difficulty: Medium Given a positive integer n, break it into the sum of at least two posit

2016-05-27 12:31:32 258

原创 91. Intersection of Two Arrays

-350. Intersection of Two Arrays II My Submissions QuestionEditorial Solution Total Accepted: 5040 Total Submissions: 12104 Difficulty: Easy Given two arrays, write a function to compute their inters

2016-05-26 22:57:01 302

原创 90. Intersection of Two Arrays

-349. Intersection of Two Arrays My Submissions QuestionEditorial Solution Total Accepted: 9033 Total Submissions: 20023 Difficulty: Easy Given two arrays, write a function to compute their intersect

2016-05-26 21:03:54 315

原创 89-Ugly Number

-263. Ugly Number My Submissions QuestionEditorial Solution Total Accepted: 58016 Total Submissions: 156829 Difficulty: Easy Write a program to check whether a given number is an ugly number.Ugly num

2016-05-26 20:40:12 213

原创 88-Product of Array

-238. Product of Array Except Self My Submissions QuestionEditorial Solution Total Accepted: 46367 Total Submissions: 107341 Difficulty: Medium Given an array of n integers where n > 1, nums, return

2016-05-26 16:03:52 230

原创 87. Nim Game

-292. Nim Game My Submissions QuestionEditorial Solution Total Accepted: 71375 Total Submissions: 134218 Difficulty: Easy You are playing the following Nim Game with your friend: There is a heap of s

2016-05-26 15:41:45 312

原创 86-Implement Stack

-225. Implement Stack using Queues My Submissions QuestionEditorial Solution Total Accepted: 40138 Total Submissions: 131270 Difficulty: Easy Implement the following operations of a stack using queue

2016-05-26 12:58:42 210

原创 map,mulitmap,set,mulitset,unordered_map,unorderer_set

关联容器:map:key-value对set: 关键字即值(要求不重复的关键字)multi:允许重复关键字unordered: 不保持关键字按顺序存储 (哈希函数组织的)如:unordered_multi_map:允许重复关键字,元素无序保存的集合使用关键字类型的比较函数,如果你的元素类型是一个类的对象或者结构体对象,那么你就需要定义

2016-05-26 11:33:01 444

原创 85-Permutations II

class Solution {public: vector<vector<int>> permute(vector<int>& nums) { //int n=nums.size(); vector<vector<int>> res; sort(nums.begin(),nums.end()); do{

2016-05-25 11:59:18 233

原创 84. Permutations

–46. Permutations My Submissions QuestionEditorial Solution Total Accepted: 101087 Total Submissions: 280282 Difficulty: Medium Given a collection of distinct numbers, return all possible permutation

2016-05-25 09:58:06 344

转载 Gprof性能分析工具

性能分析工具软件的性能是软件质量的重要考察点,不论是在线服务程序还是离线程序,甚至是终端应用,性能都是用户体验的关键。这里说的性能重大的范畴来讲包括了性能和稳定性两个方面,我们在做软件测试的时候也是要重点测试版本的性能表现和稳定性的。对于软件测试过程中发现的性能问题,如何定位有很多的方法。基本的方法可能是开发者对代码进行review,或者是使用一些工具对代码进行性能分析。常见的性能分析tu

2016-05-25 09:09:22 793

转载 c++11中nullptr(与NULL的区别)

首先呢,要明白一点儿,NULL是一个无类型的东西,而且是一个宏。而宏这个东西,从C++诞生开始,就是C++之父嗤之以鼻的东西,他推崇尽量避免宏。而在他的FAQ中,也有相应的一个关于NULL与0的解释,也谈到了这一点儿。Stroustrup: C++ Style and Technique 在C++标准中,我们可以见到一个词语叫做null pointer constant,其实在C++11标准前,是

2016-05-24 17:35:47 17298

转载 C++11中的智能指针

C++ 智能指针shared-ptr,unique_ptr和weak-ptrC++11中的智能指针在C++11中有四种只能指针,auto_ptr,shared-ptr,unique_ptr和weak-ptr。其中auto_ptr有和多不足之处,在C++11中已经建议废弃使用。shared_ptr类智能指针也是模板。所以创建智能指针时要提供其指向的指针

2016-05-24 17:31:57 1293

转载 C++标准库bitset类型的存储方式

C++标准库bitset类型的存储方式 隔了好几天,今晚终于有空来到chinaunix发表下对bitset类型的看法,最近很累,但还是抽点时间来总结一下下。前几天对bitset有一个模糊的概念,对bitset对象里面的存储顺序不太清楚,于是写了一个小程序验证了一下,终于领悟到了这点小case。首先声明一个bitset对象:bitset bitvec;bits

2016-05-24 17:30:52 671

转载 大型网站架构系列:消息队列(二)

大型网站架构系列:消息队列(二)本文是大型网站架构系列:消息队列(二),主要分享JMS消息服务,常用消息中间件(Active MQ,Rabbit MQ,Zero MQ,Kafka)。【第二篇的内容大部分为网络资源的整理和汇总,供大家学习总结使用,最后有文章来源】本次分享大纲消息队列概述(见第一篇:大型网站架构系列:分布式消息队列(一))消息队列应用场景(见第一篇:大型网站架

2016-05-24 16:09:32 416

转载 大型网站架构系列:分布式消息队列(一)

大型网站架构系列:分布式消息队列(一)以下是消息队列以下的大纲,本文主要介绍消息队列概述,消息队列应用场景和消息中间件示例(电商,日志系统)。本次分享大纲消息队列概述消息队列应用场景消息中间件示例JMS消息服务(见第二篇:大型网站架构系列:分布式消息队列(二))常用消息队列(见第二篇:大型网站架构系列:分布式消息队列(二))参考(推荐)资料(见第二篇:大型网站架构系列:分布

2016-05-24 15:51:11 633

原创 设计模式之-单例实现

class Singleton{ private static Singleton GetInstance; private static readonly object syncRoot=new object(); private Singleton(){} public static Singleton GetInstance() { i

2016-05-24 13:28:05 260

转载 深入了解cookie

会话(Session)跟踪是Web程序中常用的技术,用来跟踪用户的整个会话。常用的会话跟踪技术是Cookie与Session。Cookie通过在客户端记录信息确定用户身份,Session通过在服务器端记录信息确定用户身份。本章将系统地讲述Cookie与Session机制,并比较说明什么时候不能用Cookie,什么时候不能用Session。1.1  Cookie机制

2016-05-24 10:45:32 1063

原创 83-Add Binary

-67. Add Binary My Submissions QuestionEditorial Solution Total Accepted: 85904 Total Submissions: 309911 Difficulty: Easy Given two binary strings, return their sum (also a binary string).For exampl

2016-05-24 10:16:33 570

原创 82-Rotate List

-61. Rotate List My Submissions QuestionEditorial Solution Total Accepted: 69769 Total Submissions: 303483 Difficulty: Medium Given a list, rotate the list to the right by k places, where k is non-ne

2016-05-24 09:32:23 296

原创 81-Next Permutation

-31. Next Permutation My Submissions QuestionEditorial Solution Total Accepted: 66747 Total Submissions: 250247 Difficulty: Medium Implement next permutation, which rearranges numbers into the lexico

2016-05-23 23:45:55 236

原创 关于函数适配器less< Type>以及bind1st和bind2nd的使用

标准库定义了一组算术,关系与逻辑对象类,另外还定义了一组函数适配器 在functional头文件中: plus< Type> minus< Type> negate< Type> not_equal_to< Type> logical_not< Type>….等等 包括算术、关系、逻辑对象类型sort(svec.begin(),svec.end(),greater< string>()

2016-05-23 22:45:53 591

iphone实用项目-淘宝客户端

iphone实用项目-淘宝客户端,看看吧

2014-06-17

VC++实用界面项目

VC++下实际的项目开发,包括所有界面的重新绘制,按钮的重绘,编辑框的重绘,使得界面更加美观

2014-06-17

iphone计算器

iphone计算器,已经做好了美丽的图片,也实现了连加等,实现了运算符的优先是被

2012-05-13

空空如也

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

TA关注的人

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