会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
colors
谦谦君子,温润如玉
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
下一页
2016年4月5日
Leetcode 9. Palindrome Number(python)
摘要: 判断一个整数是否是回文数。不可以用额外的空间 我的思路很简单。就是计算首和尾,检测是否相同
阅读全文
posted @ 2016-04-05 10:01 colors
阅读(183)
评论(0)
推荐(0)
2016年4月4日
Leetcode 7. Reverse Integer(python)
摘要: 该题比较简单,但是这道题有点问题。。。。 python中的整数运算没有没有限制,但是在该oj系统中要求对大数输出0(题目并没有说明,但是在test case中可以看出) 于是偷了个懒,,,
阅读全文
posted @ 2016-04-04 16:33 colors
阅读(129)
评论(0)
推荐(0)
Leetcode 6. ZigZag Conversion(python)
摘要: 这个想法很简单,用一个列表表示每一行的字符串,最后再输出即可。 重点是找规律。
阅读全文
posted @ 2016-04-04 16:22 colors
阅读(193)
评论(0)
推荐(0)
2016年4月2日
Leetcode 94. Binary Tree Inorder Traversal(python)
摘要: 二叉树的中序遍历 迭代实现,用栈: 递归实现:
阅读全文
posted @ 2016-04-02 21:04 colors
阅读(803)
评论(0)
推荐(0)
2016年3月27日
Leetcode 4. Median of Two Sorted Arrays(python)
摘要: 求两个有序列表nums1和num2中的第k个数(finK函数),用分治法 比如对于求中位数: nums1=[11,23,35,56,78] nums2=[8,15,19,21,30,41,70] nums1的中位数35>nums2的中位数21,则两个列表的中位数一定在[11,23,35]和[21,3
阅读全文
posted @ 2016-03-27 20:55 colors
阅读(201)
评论(0)
推荐(0)
Leetcode 3. Longest Substring Without Repeating Characters(python)
摘要: 要判断最后一个不重复的子串是不是最长
阅读全文
posted @ 2016-03-27 20:40 colors
阅读(145)
评论(0)
推荐(0)
Leetcode 2. Add Two Numbers(python)
摘要: 链表操作 需要维护一个进位
阅读全文
posted @ 2016-03-27 20:26 colors
阅读(206)
评论(0)
推荐(0)
Leetcode 1. Two Sum(python)
摘要: Solution 1: 暴力求解法,时间复杂度为O(n^2),可能会超时。 Solution2: 先将数组排序(内置sort函数时间复杂度为O(nlgn)),然后用双指针。时间复杂度是O(nlgn)。 Solution 3: 题目有提示用Hash Table,以时间换空间的做法。时间复杂度为O(n)
阅读全文
posted @ 2016-03-27 19:49 colors
阅读(215)
评论(0)
推荐(0)
2016年3月2日
python下安装mysql模块失败
摘要: fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory http://www.codegood.com/downloads
阅读全文
posted @ 2016-03-02 10:09 colors
阅读(234)
评论(0)
推荐(0)
2016年1月30日
css中position属性:absolute和relative
摘要: absolute :将对象从文档流中拖出,使用 left , right , top , bottom等属性相对于其最接近的一个最有定位设置的父对象进行绝对定位。如果不存在这样的父对象,则依据 body 对象。而其层叠通过 z-index 属性定义。 relative :对象不可层叠,但将依据 le
阅读全文
posted @ 2016-01-30 15:20 colors
阅读(129)
评论(0)
推荐(0)
上一页
1
2
3
下一页
公告