自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 机器学习参考资料

最近打算把这两年收集的一些资料都分享出来,看有没有时间吧,我会按照不同方向都总结一下,看的人多的话更的会勤一点,没人看就不更了(╯‵□′)╯︵┻━┻机器学习教学资料和视频 视频-徐亦达的频道-优酷视频 Coursera公开课笔记: 斯坦福大学机器学习第一课“引言(Introduction)” | 我爱自然语言处理 大数据/数据挖掘/推荐系统/机器学习相关资源 近200篇机器学习&深度学习资

2017-01-16 22:29:10 889

原创 61. Rotate List

题意:Given a list, rotate the list to the right by k places, where k is non-negative.For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2->3->NULL.思路:这题我开始的想法分别用两个指针,一个先移k位,再两个同时向前移,比如对于上

2017-01-13 15:12:06 221

原创 82. Remove Duplicates from Sorted List II

题意: Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example,Given 1->2->3->3->4->4->5, return 1->2->5.Given 1->1->1-

2017-01-13 13:58:57 191

原创 92. Reverse Linked List II

题意: Reverse a linked list from position m to n. Do it in-place and in one-pass.For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4,return 1->4->3->2->5->NULL.Note:Given m, n satisfy the following

2017-01-13 13:20:39 176

原创 328. Odd Even Linked List

题意:Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes.You should try to do it in p

2017-01-12 22:43:38 188

原创 445. Add Two Numbers II

题意:You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contain a single digit. Add the two numbers and return

2017-01-12 22:05:47 287

原创 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?思路:一般来说判断回文肯定不会用链表来判断的,太麻烦了。。这题的目的还是用来熟悉链表的操作,方法就是先将后一般链表反转,再以一定的间隔比较各位是否相等,比如s=’1

2017-01-12 12:19:31 387

原创 Python连续赋值需要注意的地方

在python中是可以使用连续赋值的方式来一次为多个变量进行赋值的,比如:a = b = c = 1a, b, c = 1, 1, 1这些都可以完成变量的赋值,但是就有一个问题了,比如:a = 3a, b = 1, a如果按照正常的思维逻辑,先进行a = 1,在进行b = a,最后b应该等于1,但是这里b应该等于3,因为在连续赋值语句中等式右边其实都是局部变量,而不是真正的变量值本身,比如,

2017-01-11 21:14:04 25410 4

原创 206. Reverse Linked List

题意:Reverse a singly linked list.Hint:A linked list can be reversed either iteratively or recursively. Could you implement both?参考代码(非递归):def reverseList(self, head): prev = None while head:

2017-01-11 20:04:07 324

原创 237. Delete Node in a Linked List

题意: Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with value

2017-01-11 19:46:23 185

原创 203. Remove Linked List Elements

题意:Remove all elements from a linked list of integers that have value val.ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 2 --> 3 --> 4 --> 5 代码:def removeElements(self, he

2017-01-11 15:27:28 174

原创 160. Intersection of Two Linked Lists

题意:Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a1 → a2 ↘

2017-01-11 15:04:04 213

原创 83. Remove Duplicates from Sorted List

题意: Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3. 代码:def deleteDuplicates(self

2017-01-11 13:41:04 191

原创 24. Swap Nodes in Pairs

题意: 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-01-11 12:53:36 292

原创 273. Integer to English Words

题意: Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 231 - 1.For example,123 -> “One Hundred Twenty Three” 12345 -> “Twelve Thousand Three

2017-01-10 15:50:58 272

原创 214. Shortest Palindrome

题意: Given a string S, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you can find by performing this transformation.For examp

2017-01-09 22:25:25 251

原创 5. Longest Palindromic Substring

题意:Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example:Input: “babad”Output: “bab”Note: “aba” is also a valid answer.Example:Input

2017-01-09 20:53:02 215

原创 21. Merge Two Sorted Lists

题意:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.思路:就是再打断原来的两个排序链表,合成一个新的排序链表参考代码:def mergeTwoLists1(self,

2017-01-09 17:11:03 186

原创 2. Add Two Numbers

题意:You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return

2017-01-09 16:28:02 169

原创 459. Repeated Substring Pattern

题意:Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may assume the given string consists of lowercase Eng

2017-01-08 21:07:05 288

原创 KMP算法的多种模式数组next求法的比较(Python版代码)

28、Implement strStr() 题意: Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. 思路:这题在字符串中找子串,是经典的KMP算法,定义S为原字符串,T为待匹配字符串,从S中找出T

2017-01-07 22:32:05 727

原创 468. Validate IP Address

题意: In this problem, your job to write a function to check whether a input string is a valid IPv4 address or IPv6 address or neither.IPv4 addresses are canonically represented in dot-decimal notation,

2017-01-05 13:08:48 375

原创 Python split函数注意点

split函数中参数的有无对于结果是有很大影响的,无参数的split函数会去除所有空格,如图:

2017-01-04 11:02:02 837

原创 43. Multiply Strings

题意:Given two numbers represented as strings, return multiplication of the numbers as a string. Note:The numbers can be arbitrarily large and are non-negative.Converting the input string to integer is

2017-01-04 10:36:09 198

空空如也

空空如也

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

TA关注的人

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