Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]). Yo ...
分类:
其他好文 时间:
2019-03-24 19:56:26
阅读次数:
121
82. Remove Duplicates from Sorted List II Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from ...
分类:
Web程序 时间:
2019-03-23 00:36:00
阅读次数:
166
80. Remove Duplicates from Sorted Array II Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and r ...
分类:
Web程序 时间:
2019-03-23 00:30:26
阅读次数:
218
[toc] 题目链接 "Convert Sorted List to Binary Search Tree LeetCode" 注意点 不要访问空结点 题目要求的是平衡二叉搜索树(也就是AVL树) 解法 解法一:递归,二叉搜索树的中序遍历结果刚好是一个有序数组,有序数组中间的数字刚好是根节点,因此可 ...
分类:
其他好文 时间:
2019-03-22 00:16:32
阅读次数:
145
redis大key,这里指的是大的集合数据类型,如(set/hash/list/sorted set),一个key包含很多元素。由于redis是单线程,在删除大key(千万级别的set集合)的时候,或者清理过期大key数据时,主线程忙于删除这个大key,会导致redis阻塞、崩溃,应用程序异常的情况 ...
分类:
其他好文 时间:
2019-03-21 01:10:17
阅读次数:
497
Given two sorted integer arrays A and B, merge B into A as one sorted array. Note: You may assume that A has enough space (size that is greater or equ ...
分类:
其他好文 时间:
2019-03-20 20:48:27
阅读次数:
183
1.列表,元组,字典,集合分别如何增删改查及遍历。 JH = {'a', 'b', 'c', 5564} print ("原始集合 JH : ", JH)JH.remove('b')print ("删除‘b’: ", JH) 2.总结列表,元组,字典,集合的联系与区别。参考以下几个方面: 括号 有序 ...
分类:
其他好文 时间:
2019-03-19 23:06:07
阅读次数:
160
对List、Dict进行排序,Python提供了两个方法对给定的List L进行排序,方法1.用List的成员函数sort进行排序,在本地进行排序,不返回副本方法2.用built-in函数sorted进行排序(从2.4开始),返回副本,原始输入不变 sorted sorted(iterable, k ...
分类:
其他好文 时间:
2019-03-19 21:46:45
阅读次数:
178
[TOC] 题目描述: 给定一个排序链表,删除所有重复的元素,使得每个元素只出现一次。 示例 1: 示例 2: 解法: / Definition for singly linked list. struct ListNode { int val; ListNode next; ListNode(in ...
分类:
编程语言 时间:
2019-03-19 10:44:11
阅读次数:
183
Sort a linked list in O(n log n) time using constant space complexity. Example 1: Example 2: 这种答案就是让人看着非常的舒适,有一种为什么他妈的这么好的感觉,嗯 ...
分类:
其他好文 时间:
2019-03-16 12:49:23
阅读次数:
124