Redis常用的数据类型: String Hash List Set zSet Sorted set String类型 判断是否有key所对应的值,有则返回true,没有则返回false redisTemplate.hasKey(key) 有则取出key值所对应的值 redisTemplate.op ...
分类:
其他好文 时间:
2020-02-10 22:14:54
阅读次数:
1080
创建一条测试 数据 查询 (默认是 DB 0 ) 创建:set name xiaoming 查询: get name 1、模糊搜索查询 (redis 默认有16个DB , 0-15 ) Redis 模糊搜索 1、keys * 匹配数据库中所有 key 2、keys h?llo 匹配 hello , ...
分类:
其他好文 时间:
2020-02-10 17:50:59
阅读次数:
108
it ('should add two numbers', () => { const logger = jasmine.createSpyObj('LoggerService', ['log']) // logger.log.and.returnValue(); const calculator ...
分类:
其他好文 时间:
2020-02-10 09:52:34
阅读次数:
50
题意:对于一个有序数组,输出和为target的两个元素的下标。题目保证仅有唯一解。 分析: 法一:二分。枚举第一个元素,二分找另一个元素,时间复杂度O(nlogn),非最优解。 class Solution { public: vector<int> twoSum(vector<int>& numb ...
分类:
其他好文 时间:
2020-02-09 22:14:01
阅读次数:
73
Dec 30, 2019 ~ Jan 5, 2020 Algorithm Problem 88 Merge Sorted Array (合并两个有序数组) "题目链接" 题目描述:给定两个有序数组 nums1,nums2,其长度分别为m,n。假设 nums1 有足够的空间(m+n),将 nums2 ...
分类:
其他好文 时间:
2020-02-09 20:49:28
阅读次数:
77
"题目" 用hash,比较两个字符串数组的每个字符的hash值 ...
分类:
其他好文 时间:
2020-02-09 20:36:37
阅读次数:
64
Jan 6, 2020 ~ Jan 12, 2020 Algorithm Problem 108 Convert Sorted Array to Binary Search Tree (将有序数组转化为二叉搜索树) "题目链接" 题目描述:给定一个有序数组,将其转换为一个高度平衡的二叉搜索树。高度平 ...
分类:
其他好文 时间:
2020-02-09 20:18:02
阅读次数:
64
题目如下: Given an array arr of integers, check if there exists two integers N and M such that N is the double of M ( i.e. N = 2 * M). More formally check ...
分类:
其他好文 时间:
2020-02-09 18:55:33
阅读次数:
79
一、SpringMVC Spring Web MVC是一种基于Java的实现了Web MVC设计模式的请求驱动类型的轻量级Web框架,即使用了MVC架构模式的思想,将web层进行职责解耦,基于请求驱动指的就是使用请求-响应模型,框架的目的就是帮助我们简化开发,Spring Web MVC也是要简化我 ...
分类:
编程语言 时间:
2020-02-09 18:52:50
阅读次数:
82
题目如下: Given two equal-size strings s and t. In one step you can choose any character of t and replace it with another character. Return the minimum nu ...
分类:
其他好文 时间:
2020-02-09 18:39:10
阅读次数:
68