- 博客(32)
- 资源 (34)
- 问答 (1)
- 收藏
- 关注
原创 算法总结(13)--leetcode字符串,数, 转换。。。
主要是string与int转换,范围问题,还有各种数的问题65. Valid Number题目地址https://leetcode.com/problems/valid-number/题目描述Validate if a given string is numeric.Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => f
2016-10-30 09:24:09 460
原创 算法总结(12)--dfs, bfs记忆化, 减少不必要的搜索
题目地址https://leetcode.com/problems/longest-increasing-path-in-a-matrix/题目描述Given an integer matrix, find the length of the longest increasing path.From each cell, you can either move to four directions:
2016-10-29 20:07:31 2391
原创 ubuntu14.04安装gitbook和使用
gitbook 是基于nodejs的一个命令行工具,可使用 Github/Git 和 Markdown 来制作精美的电子书,可以协同开发(主要是利用github)。具体gitbook是什么自行搜索,其实没必要搞懂,会用gitbook ,git命令,这个弄熟练后 在研究原理 不迟ubuntu14.04 安装和使用安装nodejsubuntu上切记不要什么都是sudo apt-get install(
2016-10-28 20:52:41 3977
原创 PAT 字符,数字处理题,总是有坑,边界,特殊,时间复杂度
1054. 求平均值 (20)题目地址https://www.patest.cn/contests/pat-b-practise/1054注意点输入输出case4 把 “1.” 当成正确的 (坑)1052. 卖个萌 (20)题目地址https://www.patest.cn/contests/pat-b-practise/1052注意点注意点输出 \ 时 需要转义 “\”(类似还有 %等等特
2016-10-27 11:05:58 853
原创 Unique Binary Search Trees 问题(leetcode )
理解二叉查找树96. Unique Binary Search Trees题目地址https://leetcode.com/problems/unique-binary-search-trees/题目描述Given n, how many structurally unique BST’s (binary search trees) that store values 1…n?For example
2016-10-25 20:40:37 221
原创 算法总结(11)--伪递归,dfs,动态规划题,需要转换下思路
需要考虑时间复杂度和空间度,有时递归导致栈的深度太大77. Combinations题目地址https://leetcode.com/problems/combinations/题目描述Given two integers n and k, return all possible combinations of k numbers out of 1 … n.For example, If n =
2016-10-25 20:26:31 943
原创 算法总结(10)--模式匹配问题
205. Isomorphic Strings题目地址https://leetcode.com/problems/isomorphic-strings/290. Word Pattern题目地址https://leetcode.com/problems/word-pattern/10. Regular Expression Matching (递归 未解决)题目地址https://leetcode.
2016-10-23 19:16:44 675
转载 算法总结(9)--全排列问题
leetcode上涉及到的全排列,注意数组的有序,无序,数组元素是否有重复的 主要是递归算法 每个问题记住关键点,注意特殊处理–全排列问题转载 http://blog.csdn.net/morewindows/article/details/7370155/求下一序列问题转载 http://www.cnblogs.com/warmland/p/5219217.html46. Permutat
2016-10-22 21:58:08 4226
转载 310. Minimum Height Trees (无向图中,找最小高度的根)
对比题目,找最大高度根 PAT 1021. Deepest Root (25) http://blog.csdn.net/qq_26437925/article/details/49329763310. Minimum Height Trees 题目地址https://leetcode.com/problems/minimum-height-trees/求解思路参考 http://blog.
2016-10-20 21:36:12 500
原创 算法总结(8)--House Robber系列,Unique Binary Search Trees系列,动归
主要是动态规划,二叉树的动态规划,递归求解198. House Robber213. House Robber II题目地址https://leetcode.com/problems/house-robber-ii/337. House Robber III题目地址https://leetcode.com/problems/house-robber-iii/96. Unique Binary Sea
2016-10-19 19:51:26 486
原创 数独游戏(leetcode) dfs 回溯
36. Valid Sudokuhttps://leetcode.com/problems/valid-sudoku/37. Sudoku Solverhttps://leetcode.com/problems/sudoku-solver/
2016-10-18 21:32:21 525
原创 算法总结(6)--Duplicate系列查找,删除等
关于重复数字的算法题,主要是判断,查找,删除重复数字,也需要思考数组,链表求解的异同。 有用到hash,二分法的,更多的则是一种模拟,需要思路清晰,后面可以考虑代码时空的优化217. Contains Duplicate题目地址https://leetcode.com/problems/contains-duplicate/求解采用hash,直接遍历219. Contains Duplicate
2016-10-18 19:47:25 1125
转载 cocos2dx-动作
菜鸟学习Cocos2d-x 3.x——浅谈动作Action http://www.jellythink.com/archives/749动作实例简单的一个动作BezierTo // 创建精灵对象 Sprite* sp = Sprite::create("sprite.png"); sp->setPosition(Point(50, visibleSize.height / 2
2016-10-13 12:51:31 332
原创 算法总结(4)--Single Number相关问题
Single Number相关问题 主要涉及到位运算,和相关数学知识===二进制中1的个数题目地址http://www.nowcoder.com/practice/8ee967e43c2c4ec193b040ea7fbb10b8?tpId=13&tqId=11164&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-r
2016-10-12 16:37:40 563
转载 数据库中的长连接 和 短连接接
原文地址: http://blog.sina.com.cn/s/blog_6aa3070701014i4l.html概念 * 短连接 连接-》数据传输-》关闭连接; * 长连接 连接-》数据传输-》保持连接-》数据传输-》保持连接-》…………-》关闭连接;这就要求长连接在没有数据通信时,定时发送数据包,以维持连接状态,短连接在没有数据传输时直接关闭就行了。mysql连接超时,默认8个小时
2016-10-11 21:25:13 2572
原创 算法总结(1)--最大储水量相关算法题(栈,优先队列模拟)
最大储水量相关算法题 在leetcode,牛客网上类似的题目比较多,主要用到了栈,还有就是一些求解思路的问题(去掉一些无用的结果),这样降低时间复杂度==涉及到动态规划,栈模拟,优先队列等,主要是如何舍弃一些无用的结果直方图内最大矩形题目地址:http://www.nowcoder.com/practice/13ba51c3fec74b58bbc8fa8c3eedf877?tpId=49&tqId
2016-10-10 19:18:18 2137
原创 212. Word Search II (DFS,trie)
题目地址https://leetcode.com/problems/word-search-ii/题目描述Given a 2D board and a list of words from the dictionary, find all words in the board.Each word must be constructed from letters of sequentially adj
2016-10-07 15:00:22 401
原创 Subsets 子集合问题(leetcode)
78. Subsets题目地址https://leetcode.com/problems/subsets/ 题目描述Given a set of distinct integers, nums, return all possible subsets.Note: The solution set must not contain duplicate subsets.For example, If
2016-10-07 12:27:14 542
原创 数据结构课程可视化工具--个人想法
idea:专门针对数据结构的可视化工具网上有各种可视化工具,关于数据结构知识的有ppt,git,各种博客上面的讲解,各种图,完全可以综合。 对每一种数据结构,从结构定义,到如何增删该查,完全可以可视化的呈现出来 包括各种算法,也能做成可视化。总之 需要简单可操作性强。这样对于初学者的帮助应当很大。还有就是写博客的时候,总是要自己画图截图,并且画出数据结构也是比较麻烦。给可视化工具加上各种文件,远
2016-10-06 15:48:01 1425
原创 55. Jump Game (leetcode)
题目地址 https://leetcode.com/problems/jump-game/题目描述Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum
2016-10-04 18:57:51 274
原创 二叉树 层次遍历 (queue)遍历的变式题(leetcode)
利用队列结构和二叉树,变换求解116. Populating Next Right Pointers in Each Node题目地址 https://leetcode.com/problems/populating-next-right-pointers-in-each-node/117. Populating Next Right Pointers in Each Node II题目地址 h
2016-10-04 12:35:41 1123
转载 222. Count Complete Tree Nodes(leetcode) 超时
题目地址 https://leetcode.com/problems/count-complete-tree-nodes/利用完全二叉树的性质,求一颗完整二叉树的节点总数采用遍历所有节点的方法会超时,需要利用递归求解 思路参考 西施豆腐渣 http://blog.csdn.net/xudli/article/details/46385011ac代码如下/** * Definition fo
2016-10-03 12:35:13 318
原创 400. Nth Digit (leetcode) 。。。
题目的地址 https://leetcode.com/problems/nth-digit/题目描述 Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, …Note: n is positive and will fit within the range of a 32-b
2016-10-03 12:00:17 358
原创 394. Decode String(leetcode 栈模拟)
题目地址 https://leetcode.com/problems/decode-string/题目描述 Given an encoded string, return it’s decoded string.The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets
2016-10-02 12:31:52 329
转载 #ifdef __cplusplus extern “C”
原文 蓝色雪狐 http://blog.163.com/hbu_lijian/blog/static/12612915320127754526771/#ifdef __cplusplus extern "C" { #endif//一段代码#ifdef __cplusplus } #endif如果你不想理解这段代码的意义,那么请你记住:在你的代码不知道是被c调用还是c++调用时,请添加此段
2016-10-01 13:46:53 409
原创 6. ZigZag Conversion
题目地址 https://leetcode.com/problems/zigzag-conversion/一道打印题目我采用了 map来模拟,字符放的情况,当然这不是最好的做法,不过缺可以ac这道题。利用map的自动排序,可以得到某个字符具体在哪个位置ac代码如下class Solution {public: string convert(string s, int numRows) {
2016-10-01 13:05:30 286
转载 Best Time to Buy and Sell Stock 系列问题(leetcode)
关键词: 动态规划,分治121. Best Time to Buy and Sell Stock题目地址 https://leetcode.com/problems/best-time-to-buy-and-sell-stock/求最大的一次买卖122. Best Time to Buy and Sell Stock II题目地址: https://leetcode.com/problems/
2016-10-01 12:31:16 331
mvc servlet jdbc web框架
2015-06-26
wireshark tcp三次握手
2016-08-03
JavaScript基础教程
2016-02-05
java web session失效
2016-05-08
TA创建的收藏夹 TA关注的收藏夹
TA关注的人