1. 原始题目 Given a sorted linked list, delete all duplicates such that each element appear only once. Example 1: Example 2: 2. 题目理解 给定一个排序链表,删除所有重复的元素,使得 ...
分类:
其他好文 时间:
2019-04-05 12:14:40
阅读次数:
140
https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/ Given an array where elements are sorted in ascending order, convert it to a ...
分类:
其他好文 时间:
2019-04-04 14:25:49
阅读次数:
130
class Solution { public: vector twoSum(vector& numbers, int target) { int n = numbers.size(); vector result; int i = 0; for (i = 0;i<n&&numbers[i]<= t... ...
分类:
编程语言 时间:
2019-04-04 13:02:22
阅读次数:
202
Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length. Do not allocate extra ...
分类:
其他好文 时间:
2019-04-03 12:22:28
阅读次数:
146
Redis是一个key-value存储系统。和Memcached类似,它支持存储的value类型相对更多,包括string(字符串)、list(链表)、set(集合)、zset(sorted set --有序集合)和hash(哈希类型) -百度百科 1丶下载php对应的redis php开启Redi ...
一:数据库分类 数据库分为两类: 关系型数据库:以一条条记录的形式存储在表中的数据库称之为关系型数据库。例如:mysql,Oracle等。 非关系型数据库:没有表的概念,数据以key value 的形式存储的数据库称之为菲关系型数据库。例如:Redis,MongoDB等。Redis是存储在内存中的数 ...
分类:
数据库 时间:
2019-04-02 00:14:38
阅读次数:
190
map、reduce、filter、sorted函数Python内置map、reduce、filter、sorted函数。map函数map函数接受两个参数,一个是函数,一个是Iterable(迭代对象),map将传入的函数依次作用到序列的每个元素,并把结果作为新的Iterator返回。有一个函数f(x)=x2,要把这个函数作用到一个list[1,2,3,4]上,用map实现:map传入第一个参数是
分类:
编程语言 时间:
2019-04-01 18:47:00
阅读次数:
164
Redis是一个key-value的nosql产品,与Memcached有些类似,但它存储的value类型相对更加丰富,包括string(字符串)、list(链表)、set(集合)、zset(sorted set有序集合)和hasg。与memcached一样,为了保证效率,数据都是缓存在内存中。区别 ...
分类:
其他好文 时间:
2019-04-01 01:01:36
阅读次数:
192
Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function ...
分类:
其他好文 时间:
2019-03-30 17:22:24
阅读次数:
163