地址:https://leetcode.com/problems/merge-sorted-array/ 描述: Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. ...
分类:
其他好文 时间:
2019-04-30 23:18:53
阅读次数:
162
[TOC] 有名函数(掌握) 我们之前定的函数都是有名函数,它是基于函数名使用。 from func from func from func 匿名函数(掌握) 匿名函数,他没有绑定名字,使用一次即被收回,加括号既可以运行。 (x, y) 3 与内置函数联用(掌握) 匿名函数通常与max()、min( ...
分类:
其他好文 时间:
2019-04-30 01:10:51
阅读次数:
114
Algorithm 本周的算法题是删除已排序数据中的重复数字(https://leetcode.com/problems/remove-duplicates-from-sorted-array/)。这道题比较简单,基本思路是从开头比较,遇到不同的数字,就进行替换 Reading 这周看的英文文章是《 ...
分类:
其他好文 时间:
2019-04-29 09:42:17
阅读次数:
117
使用python对列表(list)进行排序,说简单也简单,说复杂也复杂,我一开始学的时候也搞不懂在说什么,只能搜索一些英文文章看看讲解,现在积累了一些经验,写在这里跟大家分享,我们通过例子来详细解释一下函数sorted的具体用法: 先创建一个列表a 直接使用sorted方法,返回一个列表就是排序好的 ...
分类:
编程语言 时间:
2019-04-28 17:12:10
阅读次数:
127
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [ 1->4->5, 1->3->4, 2->6 ] Output: ...
分类:
编程语言 时间:
2019-04-27 12:59:20
阅读次数:
124
https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/discuss/27976/3-6-easy-lines-C%2B%2B-Java-Python-Ruby 描述 Follow up for "Remove Du ...
分类:
编程语言 时间:
2019-04-27 09:25:45
阅读次数:
154
[LeetCode] Remove Duplicates from Sorted Array 有序数组中去除重复项 描述 Given a sorted array nums, remove the duplicates in-place such that each element appear o ...
分类:
编程语言 时间:
2019-04-27 00:51:03
阅读次数:
152
描述 Given a sorted linked list, delete all duplicates such that each element appear only once. Example 1: Input: 1->1->2Output: 1->2Example 2: Input: 1 ...
分类:
编程语言 时间:
2019-04-27 00:30:34
阅读次数:
149
群里有同行遇到这样一个面试题:有一个整数构成的列表,需要给这个列表进行从小到大存入到另一个列表中。 本身排序可以用python的内置函数sort和sorted,但题目的要求是手动实现。 看起来很简单,实现的发现并不容易,花了半个小时才调试好。 解题思路: 1.将列表中的第1个元素放入新列表,然后将元 ...
分类:
编程语言 时间:
2019-04-26 20:48:59
阅读次数:
167
Redis是一个使用 ANSI C 编写的开源、支持网络、基于内存、可选持久性的键值对存储数据库。其数据是保存在内存中,同时可定时把内存数据同步到磁盘,将数据持久化,比memcached支持更多的数据结构:string,list,set,sorted set,hash。 redis的应用: 登录会话 ...
分类:
其他好文 时间:
2019-04-26 16:15:38
阅读次数:
175