首页 > 2015年03月20日 > 全部分享
LeetCode – Refresh – Longest Consecutive Sequence
It use the hashset to do the tricks. 1 class Solution { 2 public: 3 int longestConsecutive(vector &num) { 4 int len = num.size(), result =...
分类:其他   时间:2015-03-20 08:02:13    收藏:0  评论:0  赞:0  阅读:280
LeetCode – Refresh – Linked List Cycle II
1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * ListNode(int x) : val(x), ne...
分类:其他   时间:2015-03-20 08:02:03    收藏:0  评论:0  赞:0  阅读:315
【转化,排序,二分】
问题描述给定平面上n个点。求两条直线,这两条直线互相垂直,而且它们与x轴的夹角为45度,并且n个点中离这两条直线的曼哈顿距离的最大值最小。两点之间的曼哈顿距离定义为横坐标的差的绝对值与纵坐标的差的绝对值之和,一个点到两条直线的曼哈顿距离是指该点到两条直线上的所有点的曼哈顿距离中的最小值。输入格式第一...
分类:编程语言   时间:2015-03-20 08:01:53    收藏:0  评论:0  赞:0  阅读:264
LeetCode – Refresh – Largest Rectangle in Histogram
Use two vector to record left and right indexes that can extend the blocks. 1 class Solution { 2 public: 3 int largestRectangleArea(vector &height...
分类:其他   时间:2015-03-20 08:01:43    收藏:0  评论:0  赞:0  阅读:323
LeetCode – Refresh – Letter Combination of a Phone Number
This is just a combination. Use hashtable to hold the number ==> charsnotes:1. check corner case : input is empty, do not return vector contains empty...
分类:其他   时间:2015-03-20 08:01:33    收藏:0  评论:0  赞:0  阅读:350
母版页 VS shtml—ASP.NET细枝末节(3)
这算是html的重用吧? 网页很多地方长得一样,也有不一样的地方。 把网页中一样的地方,提取出来,形成一个文档。 在其他网页中引用,是网站开发的一个传统的思维。 当然不同的技术有不同的表现形式。 例如php,asp啦这些语言直接写个include就好了。 而asp.net中呢? webform中,提...
分类:Web开发   时间:2015-03-20 08:01:23    收藏:0  评论:0  赞:0  阅读:291
常用设计模式的类图
分类:其他   时间:2015-03-20 08:01:13    收藏:0  评论:0  赞:0  阅读:327
Spring JdbcTemplate 与 事务管理
Spring的JDBC框架能够承担资源管理和异常处理的工作,从而简化我们的JDBC代码, 让我们只需编写从数据库读写数据所必需的代码。Spring把数据访问的样板代码隐藏到模板类之下, 结合Spring的事务管理,可以大大简化我们...
分类:数据库技术   时间:2015-03-20 07:00:13    收藏:0  评论:0  赞:0  阅读:398
玩转树莓派- RaspBerry,Qt5交叉编译移植新手指南
Raspberry Pi (BCM2835): Device Information Architecture ARMv6 CPU ARM11 RAM 256MB OR 512MB since October 2012 (shared with?GPU) GPU VideoCore IV OpenGL OpenGL ES 2.0 Multimedia OpenMax IL 1.1.2 Qt...
分类:Web开发   时间:2015-03-20 07:00:03    收藏:0  评论:0  赞:0  阅读:995
位运算和关于两个数交换的多种方法
用位运算来交换两个数的值,值得学习...
分类:其他   时间:2015-03-20 06:59:13    收藏:0  评论:0  赞:0  阅读:311
iOS 时间类常用方法
iOS 时间类常用方法...
分类:移动平台   时间:2015-03-20 06:58:59    收藏:0  评论:0  赞:0  阅读:304
LeetCode – Refresh – Largest Number
Corner case: when all the elements are 0. It should return "0", not "00000000".It use string to compare all the numbers. 1 class Solution { 2 public: ...
分类:其他   时间:2015-03-20 06:56:33    收藏:0  评论:0  赞:0  阅读:300
python+postgreSql
def getopenconnection(user='postgres', password='1234', dbname='dds_assgn1'): return psycopg2.connect("dbname='" + dbname + "' user='" + user + "' ...
分类:数据库技术   时间:2015-03-20 06:56:23    收藏:0  评论:0  赞:0  阅读:442
养生四字经
衣衣不过厚,不怕温高,衣不过薄,不怕风高。食吃米带糠,吃菜带帮,男不离韭,女不离藕,青红萝卜,生克熟补,食不过饱,饱不急卧。住春不露脐,夏不睡石,秋不睡板,冬不蒙头。按时入睡,定时起床,起身要慢,勿急勿慌。行站如松直,坐如钟稳,动如风意,睡如弓形。传统的养生之道:养身在动,养心在静。饮食有节,起居有...
分类:其他   时间:2015-03-20 06:56:13    收藏:0  评论:0  赞:0  阅读:254
LeetCode – Refresh – Jump Game II
Same with Jump Game I. Just need a step parameter and assume there is no "0" value in the array. 1 class Solution { 2 public: 3 int jump(int A[], ...
分类:其他   时间:2015-03-20 06:55:23    收藏:0  评论:0  赞:0  阅读:198
LeetCode – Refresh – Insertion Sort List
Do not forget to break the inner loop, when you find the insert position. 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * ...
分类:其他   时间:2015-03-20 06:54:23    收藏:0  评论:0  赞:0  阅读:295
LeetCode – Refresh – Intersection of Two Linked Lists
Find the common length part, then check with two pointers. 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 *...
分类:其他   时间:2015-03-20 06:54:03    收藏:0  评论:0  赞:0  阅读:309
c/c++: c++函数返回类型什么情况带const
c++ 函数的返回类型,包括const 什么时候起作用呢?函数返回值不想其立即修改的。 例子如下,这是一个简单的避免产生隐形返回变量的方法,abc 的函数返回是引用,main函数中第10行,++ 操作是基于 const int & 类型,所以会出错,但以后对改引用的操作不会受到const 约束...
分类:编程语言   时间:2015-03-20 06:53:53    收藏:0  评论:0  赞:0  阅读:325
[Javascript] Gradient Fills on the HTML5 Canvas
window.onload = function() { var canvas = document.getElementById("canvas"), context = canvas.getContext("2d"); var gradient =context.cre...
分类:编程语言   时间:2015-03-20 06:53:43    收藏:0  评论:0  赞:0  阅读:300
SQL之透视、逆透视及分组集
透视假如当前有数据源如下所示:有一报表需求如下所示:这一类的需求就称之为数据透视转换。透视转换一般涉及分组、扩展及聚合三个阶段。上面的需求是按照empid进行分组,按照custid对订货量进行扩展,最后进行聚合SUM(qty)。数据透视转换其实是存在某种通用查询模板的。下面是上面这个需求的标准SQL...
分类:数据库技术   时间:2015-03-20 06:53:33    收藏:0  评论:0  赞:0  阅读:388
2008条   上一页 1 ... 89 90 91 92 93 ... 101 下一页
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!