zoukankan      html  css  js  c++  java
  • redis键操作

    设置键

    [root@host ~]# /usr/local/redis/bin/redis-cli 
    127.0.0.1:6379> set name linux
    OK
    127.0.0.1:6379> get name
    "linux"
    127.0.0.1:6379> keys *
    1) "name"
    

    判断键是否存在

    127.0.0.1:6379> exists name
    (integer) 1
    127.0.0.1:6379> exists hehe
    (integer) 0
    如果存在返回整数类型1.否则返回0
    

    删除键

    127.0.0.1:6379> del name
    (integer) 1
    127.0.0.1:6379> del name
    (integer) 0
    

    获取键值的数据类型

    127.0.0.1:6379> type name
    

    注意:如果算法的执行时间不随着问题规模n的增加而增长,即使算法中有上千条语句,其执行时间也不过是一个较大的常数。此类算法的时间复杂度是O(1)

  • 相关阅读:
    053705
    053704
    053703
    053702
    053701
    053700
    053699
    053698
    053697
    HDU 3746 Cyclic Nacklace
  • 原文地址:https://www.cnblogs.com/Csir/p/8206304.html
Copyright © 2011-2022 走看看