原题地址:https://oj.leetcode.com/problems/merge-two-sorted-lists/题意:Merge two sorted linked lists and return it as a new list. The new list should be made...
分类:
编程语言 时间:
2014-06-15 21:58:31
阅读次数:
238
先说我自己用的情况:最先用的memcache ,用于键值对关系的服务器端缓存,用于存储一些常用的不是很大,但需要快速反应的数据 然后,在另一个地方,要用到redis,然后就去研究了下redis. 一看,显示自己安装了php扩展,因为有服务器上的redis服务端,自己本地就没有安装,其实用法和memc...
分类:
数据库 时间:
2014-06-15 18:28:38
阅读次数:
315
旋转数组中的查找。[1, 2, 3, 4, 5, 6]的一个旋转数组为[4, 5, 6, 1, 2, 3]。在旋转数组中寻找一个数。
最直接的方法,一次遍历,时间复杂度O(n)。但是既然是一个部分有序的数组,那么对于有序的部分我们可以想方法用二分查找。这个效率可以提高。
代码:
.......
分类:
其他好文 时间:
2014-06-15 17:33:21
阅读次数:
195
题目
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
You may assume no duplicates i...
分类:
其他好文 时间:
2014-06-15 17:27:16
阅读次数:
251
题目
Given a sorted array of integers, find the starting and ending position of a given target value.
Your algorithm's runtime complexity must be in the order of O(log n).
If the target i...
分类:
其他好文 时间:
2014-06-15 16:53:32
阅读次数:
177
ledisdb现在已经支持replication机制,为ledisdb的高可用做出了保障。使用假设master的ip为10.20.187.100,端口6380,slave的ip为10.20.187.101,端口为6380.首先我们需要master打开binlog支持,在配置文件中指定:use_bin_log : true
在slave的机器上面我们可以通过配置文件指定slaveof开启replic...
分类:
数据库 时间:
2014-06-15 16:44:32
阅读次数:
266
题目
Given a sorted array of integers, find the starting and ending position of a given target value.
解题思路:
查找一个数出现的范围,给一个排好序的数组和一个数,找出这个数在数组中出现的范围。
这个题直接使用一次遍历就可以得到结果,这样的时间复杂度为O(n)。但是对于有序数组我们一般可以使用二分查找可以得到更好的O(logn)的时间复杂度。我们可以使用二分查找找到这个数第一次出现的位置和这个数最后一次出现的位...
分类:
其他好文 时间:
2014-06-15 16:19:16
阅读次数:
237
一、Redis基础部分:1、redis介绍与安装比mysql快10倍以上*****************redis适用场合****************1.取最新N个数据的操作2.排行榜应用,取TOPN操作3.需要精确设定过期时间的应用4.计数器应用5.Uniq操作,获取某段时间所有数据排重值6...
分类:
其他好文 时间:
2014-06-14 22:45:48
阅读次数:
478
题目
Follow up for "Search in Rotated Sorted Array":
What if duplicates are allowed?
Would this affect the run-time complexity? How and why?
Write a function to determine if a given target is in the array.
原题链接(点我)
解题思路
这题和Search in Rotated Sorted Array问题类似,...
分类:
其他好文 时间:
2014-06-14 12:44:18
阅读次数:
266
求监控组的大哥大妹子们干点事,真不容易!要问他们是谁?他们是神。轻易别找他们,因为找了也是白找。上次因为python和redis长时间brpop的时候,会有线程休眠挂起的情况,所有通知报警平台被下线了。这次算是完美解决了。再把他给上线。这两公司的告警已经开始往我这边的接口..
分类:
数据库 时间:
2014-06-13 21:08:17
阅读次数:
414