Given a sorted linked list, delete all duplicates such that each element appear only once. Example 1: Example 2: time: O(n), space: O(1) ...
分类:
其他好文 时间:
2018-12-27 10:23:57
阅读次数:
118
Convert a BST to a sorted circular doubly-linked list in-place. Think of the left and right pointers as synonymous to the previous and next pointers i ...
分类:
其他好文 时间:
2018-12-27 10:23:29
阅读次数:
178
Given a sorted (in ascending order) integer array nums of n elements and a target value, write a function to search target in nums. If target exists, ...
分类:
编程语言 时间:
2018-12-26 20:13:03
阅读次数:
209
Python总结篇——知识大全 python装饰器 PyCharm安装与配置,python的Hello World sort与sorted的区别及实例 我必须得告诉大家的MySQL优化原理 Python四大主流网络编程框架 验证码的爬取和识别详解 Flex 布局:实例篇 http和socket之长连 ...
分类:
编程语言 时间:
2018-12-26 20:07:45
阅读次数:
205
描述 我们需要对List进行排序,Python提供了两个方法对给定的List L进行排序 : 方法1.用对List的成员函数sort进行排序方法2.用内置函数sorted进行排序(从2.4开始) sorted sorted() 函数对所有可迭代的对象进行排序操作 >>> help(sorted) H ...
分类:
其他好文 时间:
2018-12-26 19:51:25
阅读次数:
170
[TOC] 本文积累一些高效的scala写法。 Ordering toSeq is not good idea because driver needs to put this in memory 但是通过函数传递ordering的方式比较慢,直接Ordering.by创建内置的Ordering,或 ...
分类:
其他好文 时间:
2018-12-26 00:28:50
阅读次数:
140
Difficulty: Easy More:【目录】LeetCode Java实现 Description Merge two sorted linked lists and return it as a new list. The new list should be made by splici ...
分类:
其他好文 时间:
2018-12-24 20:22:44
阅读次数:
139
本人编程小白,如果有写的不对、或者能更完善的地方请个位批评指正! 这个是leetcode的第34题,这道题的tag是数组,需要用到二分搜索法来解答 34. Find First and Last Position of Element in Sorted Array Given an array o ...
分类:
编程语言 时间:
2018-12-24 13:21:36
阅读次数:
277
内置函数——filter、map和reduce filter filter()函数接收一个函数 f 和一个list,这个函数 f 的作用是对每个元素进行判断,返回 True或 False,filter()根据判断结果自动过滤掉不符合条件的元素,返回由符合条件元素组成的新list。 例如,要从一个li ...
分类:
其他好文 时间:
2018-12-23 19:35:45
阅读次数:
125
本人编程小白,如果有写的不对、或者能更完善的地方请个位批评指正! 这个是leetcode的第35题,这道题的tag是数组,python里面叫list,需要用到二分搜索法 35. Search Insert Position Given a sorted array and a target valu ...
分类:
编程语言 时间:
2018-12-23 11:22:31
阅读次数:
191