Given a linked list, return the node where the
cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it
without using extra space?首先不...
分类:
其他好文 时间:
2014-05-09 10:42:09
阅读次数:
329
题目描述N integers are arranged on a circle clockwise.
Given two integers M and K. For each position, you should take M continuous
integers on the left an...
分类:
其他好文 时间:
2014-05-09 10:30:49
阅读次数:
350
HDU 1061 Rightmost Digit分类: ACM 算法 2011-12-17 17:37
749人阅读 评论(2) 收藏 举报integeroutputinputeach算法c Problem DescriptionGiven a positive
integer N, you sh....
分类:
其他好文 时间:
2014-05-09 10:20:14
阅读次数:
243
CommandActionNotesvim file +54open file and go to
line 54any : command can be run using + on command linevim -O file1 file2open
file1 and file2 side b...
分类:
其他好文 时间:
2014-05-09 10:15:18
阅读次数:
420
图的遍历主要有两种方法,第一种是之前博文中介绍过的“图的深度优先遍历”,简称DFS;另一种就是图的广度优先遍历(BFS),在本文中将进行简要探讨。
BFS要做的事,从给定点出发,遍历的一次探寻到所有顶点。其基本思路很容易理解,在此我们利用队列q来存储访问的顶点,用visited[]数组(初始化所有值...
分类:
其他好文 时间:
2014-05-09 10:06:35
阅读次数:
337
1. ConfigurationManager的命名空间:using
System.Configuration;2.To be able to save you have to use a configuration object
returned by the OpenExeConfigurati...
分类:
移动开发 时间:
2014-05-09 03:03:07
阅读次数:
596
题意:给定一张地图,并且给定起点和终点,求起点到终点的最短距离,地图上有墙,与以往的题目不同的是,以往的题目障碍物都是在格子上,但是本题的障碍物墙是在格子与格子的边界线上,所以在输入的时候就要进行预处理下,将墙的位置转化为相邻格子的东西南北方向墙的状态,所以使用了一个3为数组来记录地图的信息map[x][y][0]-map[x][y][3] 分别表示坐标为x,y的格子的四个方向墙的情况,0为没墙,1为有墙,然后一个dfs找到最短路,以及每个点的前驱节点,最后打印路径。代码中的注释很详细。题目本身很简单,就是...
分类:
其他好文 时间:
2014-05-09 02:19:55
阅读次数:
454
sys.c 代码分析
setregid
/*
* This is done BSD-style, with no consideration of the saved gid, except
* that if you set the effective gid, it sets the saved gid too. This
* makes it possib...
分类:
系统相关 时间:
2014-05-09 02:13:12
阅读次数:
621
第一部分:DFS
DFS(深度优先搜索),深度优先搜索法与回溯法差不多,主要的区别是回溯法在求解过程中不保留完整的树结构,而深度优先搜索则记下完整的搜索树,搜索树起记录解路径和状态判重的作用。为了减少存储空间,在深度优先搜索中,用标志的方法记录访问过的状态,这种处理方法使得深度优先搜索法与回溯法没什么区别了。
深度优先搜索所遵循的搜索策略是尽可能“深”地搜索图。...
分类:
其他好文 时间:
2014-05-09 01:49:49
阅读次数:
304
【共享keychain数据】
当往keychain中插入数据时,默认的kSecAttrAccessGroup就是App自身的BundleID。【官方文档】 You can add a
keychain-access-groups entitlement to the application an.....
分类:
其他好文 时间:
2014-05-08 23:21:42
阅读次数:
370