自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(8)
  • 收藏
  • 关注

原创 LeetCode 24. Swap Nodes in Pairs (Python)

题目描述:Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant space. You ma

2017-07-31 21:40:14 324

原创 LeetCode 19. Remove Nth Node From End of List (Python)

题目描述: Given a linked list, remove the nth node from the end of list and return its head.For Example:Given linked list: 1->2->3->4->5, and n = 2.After removing the second node from the end, the linked

2017-07-30 22:28:59 321

原创 LeetCode 11. Container With Most Water (Python)

题目描述: Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find

2017-07-28 20:27:53 475

转载 KNN算法(基于KD-Tree)

输入数据可以自己调,设置要查的point和k值后返回最邻近的k个pointimport numpy as npclass KD_Node: def __init__(self, point=None, split=None, leftNode=None, rightNode=None): """ :param point:数据点 :param

2017-07-19 20:34:24 668

原创 LeetCode 234. Palindrome Linked List

题目描述: Given a singly linked list, determine if it is a palindrome.Follow up: Could you do it in O(n) time and O(1) space?AC代码:class Solution(object): def isPalindrome(self, head): """

2017-07-16 17:21:25 205

原创 LeetCode 7.Reverse Integer

题目描述:Reverse digits of an integer.Example1: x = 123, return 321 Example2: x = -123, return -321Note: The input is assumed to be a 32-bit signed integer. Your function should return 0 when the reverse

2017-07-12 15:47:27 379

原创 LeetCode 16.3Sum Closest

题目描述:Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exa

2017-07-12 15:17:58 245

原创 LeetCode 1.Two Sum (Python)

题目描述: Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the s

2017-07-12 15:13:45 280

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除