排序:
默认
按更新时间
按访问量

leetcode-top100-liked-questions-medium

1、Target SumYou are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you sh...

2018-07-11 20:39:38

阅读数:38

评论数:0

leetcode-top 100 liked questions-python

1、Find All Anagrams in a StringGiven a string s and a non-empty string p, find all the start indices of p's anagrams in s.Strings consists of lowerca...

2018-06-24 16:27:07

阅读数:54

评论数:0

leetcode-easy-python

1、Excel Sheet Column TitleGiven a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 ->...

2018-06-24 12:25:40

阅读数:16

评论数:0

leetcode-sql

1、Second Highest SalaryWrite a SQL query to get the second highest salary from the Employee table.+----+--------+ | Id | Salary | +----+--------+ | 1...

2018-06-24 11:58:26

阅读数:22

评论数:0

top interviews questions-leetcode-python附代码详解

1、Convert Sorted Array to Binary Search Tree(将升序的数组转换成平衡二叉树):2、Happy Number3、Min Stack-实现返回最小元素的栈4、Plus One数组的值转成数值,加1之后,输出值的列表形式5、判断一个数是否是3的幂6、 Pasc...

2018-04-17 23:55:03

阅读数:95

评论数:0

dynamic-programming-python-leetcode(动态规划)

1、Min Cost Climbing StairsOn a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed).Once you pay the cost, you can either...

2018-03-26 17:29:52

阅读数:139

评论数:0

Array-leetcode-python

1、Array Partition IGiven an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn)...

2018-03-26 14:13:43

阅读数:22

评论数:0

leetcode-python-binary search

1、Two Sum II - Input array is sortedGiven an array of integers that is already sorted in ascending order, find two numbers such that they add up to a...

2018-03-25 19:50:43

阅读数:22

评论数:0

leetcode-Tree-python

1、Same TreeGiven two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same if they are structu...

2018-03-23 16:11:08

阅读数:19

评论数:0

Minimum Index Sum of Two Lists-python

解答:运用python的dict快速创建hash索引class Solution(object):    def findRestaurant(self, list1, list2):        pos1={v:pos for pos,v in enumerate(list1)} # 对lis...

2018-03-22 14:03:20

阅读数:38

评论数:0

Intersection of Two Linked Lists-python

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: ...

2018-03-22 13:36:29

阅读数:14

评论数:0

Linked List Cycle II-python

解答:要想得知链表环开始的地方,需要先判断链表是否有环(参考本博客Linked List Cycle),当判断为有环时,记住当前所指的位置,将其中一个指针重置到链表头部,两个指针开始以相同步长1往后遍历链表,当再次相遇时,即环开始的地方class Solution:    # @param hea...

2018-03-22 13:08:36

阅读数:29

评论数:0

Linked List Cycle(判断链表是否有环)-python

Given a linked list, determine if it has a cycle in it.解答:定义两个指针分别从链表头部开始,一个指针每次走一步,另一个指针每次走两步,若两个指针所指的值相等,则说明有环,否则没环;要注意指针所指之处是否为空class Solution(obj...

2018-03-22 12:55:43

阅读数:73

评论数:0

Remove Duplicates from Sorted List-python

Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1-&...

2018-03-22 12:35:34

阅读数:15

评论数:0

Merge Two Sorted Lists-python

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.Example:...

2018-03-22 11:04:14

阅读数:38

评论数:0

Palindrome Number(判断数字是不是回文数)-python

Determine whether an integer is a palindrome. Do this without extra space.解答 : 有的答案是把数转成字符串,逆序之后与原来的相等,那么就是回文数;本人提供的答案是,设置两个指针,分别指向头部和尾部,对比对应的数是否相等,直...

2018-03-22 10:54:57

阅读数:28

评论数:0

Reverse Integer-python

Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123 Output: 321 Example 2:Input: -123 Output: -321 Example 3:Input: 120...

2018-03-22 10:38:28

阅读数:31

评论数:0

leetcode-Two sum(最佳思路以及python代码实现)

1、Two sumGiven nums = [2, 7, 11, 15], target = 9, Because nums[0] + nums[1] = 2 + 7 = 9, return [0, 1].答案:使用hashtable,建立数组值和下标的键值对,在python中相当于使用dict...

2018-03-22 10:17:57

阅读数:208

评论数:0

ID3、C4.5、CART、随机森林、bagging、boosting、GBDT、xgboost算法总结

参考本人在知乎上面分享的总结~https://zhuanlan.zhihu.com/p/34534004, 希望可以帮助到大家

2018-03-22 09:33:21

阅读数:44

评论数:0

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