题目描述:
Given a linked list, return the node where the cycle begins. If there is no cycle, return null.
Follow up:
Can you solve it without using extra space?
思路:
设置一个快指针fast,一个慢指针slow。快指...
分类:
其他好文 时间:
2014-11-11 16:41:06
阅读次数:
179
题目描述:
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
思路:初始化一个快指针fast,一个慢指针slow。快指针一次移动两个单位,慢指针一次移动一个单位。如果链表有环,则两指针必然会相遇。否则若fas...
分类:
其他好文 时间:
2014-11-11 16:40:35
阅读次数:
208
一般通过以下两种方式定位执行效率较低的 SQL 语句。通过慢查询日志定位那些执行效率较低的 SQL 语句,用 --log-slow-queries[=file_name] 选项启动时, mysqld 会 写一个包含所有执行时间超过 long_query_time 秒的 SQL 语句的日志文件,通过查...
分类:
数据库 时间:
2014-11-09 08:32:43
阅读次数:
163
背景是某个业务的logdb历史oss_log(MyISAM表类型)例行删除,有时候会告"deadlock"。分析slow log发现有些删除需要很长时间,比如:drop table 2014_10_17_oss_abandonquest 花费了15041.2410秒。删除行为在凌晨4点发出,刚好落在备份期间,因为5.5有了MDL(Meta data lock),所以–single-transact...
分类:
数据库 时间:
2014-11-09 01:07:58
阅读次数:
187
Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds'
数据源在国内访问网速过慢,可参考以下数据源:
http://mongo.a.mesa.io/repo/redhat/os/x86_64/
http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
http://repo.mongodb.org/repo/redhat/os/x86_64...
分类:
数据库 时间:
2014-11-06 21:54:25
阅读次数:
290
http://xiaobin.net/201112/ssh-login-quite-slow/同样的问题,有可能是两种情况:第一种情况比较常见,也有很多资料提及到,就是在SSH登陆时服务器端会对客户端的IP进行反解析造成登陆响应慢的问题,通常改sshd_config的“UseDNS no”即可以。第...
分类:
其他好文 时间:
2014-11-05 12:08:10
阅读次数:
153
今天来依照apidemos提供的方法来实现slow loading的效果.简单说下实现方法:实现ListView.OnScrollListener ,监听到手势滑动的情况,当处于滚动状态时,将新显示的items 设置为Loading , 当离开屏幕时,才载入真实的数据.设置数据时,要用到getFir...
mysql的日志文件 日志文件大致分为error log,binary log,query log,slow query log,innodb redo log ;如图:1.error logthe error log file contains information indicating wh....
分类:
数据库 时间:
2014-10-30 23:52:40
阅读次数:
462
function goTop() {$('html, body').animate({scrollTop:0}, 'slow'); }function goDiv(div) {var a = $("#"+div).offset().top;$("html,body").animate({scroll...
分类:
其他好文 时间:
2014-10-30 14:55:15
阅读次数:
218
jquery treeview 插件参数说明treeview开源地址:https://github.com/jzaefferer/jquery-treeview1、animated:String or Number设置展开子节点时的显示速度,有 slow、normal、fast 或者指定速度值,与 ...
分类:
Web程序 时间:
2014-10-29 14:33:49
阅读次数:
201