My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
LrangeCommand  
Updated Dec 21, 2010 by anti...@gmail.com

We moved to Redis.io!

Redis home moved to http://redis.io, please visit our new home.

Comment by dhruvb...@gmail.com, Jan 12, 2010

"LRANGE key start end Time complexity: O(n) (with n being the length of the range)"

However, LINDEX is also O(n), with n being the length of the list. How??

Comment by marcua@gmail.com, Mar 16, 2010

@dhruvbird These lists are linked lists. So asking for element i (LINDEX with index i) in the list requires a traversal of i items from the start of the list. This means in worst case, you ask for the next-to-last element in the list, which takes time n-1, or O(n).

Comment by tbmcmul...@gmail.com, Apr 18, 2010

I believe dhruvbird's point is that LINDEX can't be O(length of the list) while LRANGE is O(length of the range)... LRANGE must also be O(length of the list).

Comment by bandu...@gmail.com, May 26, 2010

Hi team, isn't it good to support multi-value insersion operation (similar to LRANGE returning multi-value)? Is there specific reason not to have this which could very helpfull in DB initiation?


Sign in to add a comment
Powered by Google Project Hosting