腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
首页
学习
活动
专区
工具
TVP
最新优惠活动
返回腾讯云官网
Bingo的深度学习杂货店
专栏作者
举报
183
文章
152329
阅读量
43
订阅数
订阅专栏
申请加入专栏
全部文章(183)
编程算法(111)
python(92)
其他(23)
数据结构(20)
二叉树(6)
php(4)
dp(4)
java(3)
c++(3)
html(3)
神经网络(3)
机器学习(2)
数据库(2)
深度学习(2)
决策树(2)
tcp/ip(2)
numbers(2)
对象存储(1)
tensorflow(1)
javascript(1)
node.js(1)
json(1)
ide(1)
spring(1)
文件存储(1)
图像处理(1)
网络安全(1)
html5(1)
图像识别(1)
正则表达式(1)
监督学习(1)
keras(1)
无监督学习(1)
anaconda(1)
安全(1)
windows(1)
add(1)
combinations(1)
grid(1)
image(1)
input(1)
leetcode(1)
max(1)
output(1)
path(1)
point(1)
python3(1)
requests(1)
row(1)
target(1)
url(1)
动态规划(1)
队列(1)
多进程(1)
搜索文章
搜索
搜索
关闭
三个数的和小于等于k
编程算法
数据结构
给一个数组以及一个数K, 从这个数组里面选择三个数,使得三个数的和小于等于K, 有多少种选择的方法?(不包括重复的情况) Example: Input: nums = [3,2,5,2,1,4,2,3] k = 7 Output: 6 # [1,2,4], [1,2,3], [1,2,2], [1,3,3], [2,2,2], [2,2,3] 解题思路: 这个题是“三个数的和等于K”的变形,主要难点在于去重。首先,还是先列表从小到大排序,然后外循环遍历 nums[0...n-2],将三个数问题转化为两个
echobingo
2018-04-25
1.5K
0
KMP 算法
编程算法
数据结构
题目描述:Leetcode 28. Implement strStr() 之前在 Leetcode 上 AC 的 O(MN) 版本:Q28 Implement strStr() 解题思路: KMP 算法是经典的求解子串(模式串)出现在主串中位置的算法,也是数据结构当时学习的一个知识点。它因为在匹配过程中,主串下标不后退,而可以使时间复杂度从 O(MN) 降为 O(M+N) 。之前学过忘了,现在在此做一个总结。 KMP 算法的关键:求出子串(模式串)的 next 数组。 举例: 子串 pattern 下标
echobingo
2018-04-25
811
0
最小方差划分
编程算法
数据结构
给一个数组,求一个k值,使得前k个数的方差 + 后面n-k个数的方差最小 解题思路: 如果不考虑方差的概念,这题可以简化为 “给一个数组,求一个k值,使得前k个数的和 + 后面n-k个数的和最小”。 举例, 如 nums = [1,3,2,4],我们可以先从左向右求出各个子段和 [1,4,6,10],然后再从右向左求出各个子段和 [4,6,9,10],我们发现对应的子段和为 1 -> 9, 4 -> 6, 6 -> 4。因此,我们只需要正反遍历数组两次,就可以求得结果。 时间复杂度:O(n),空间复杂度 O
echobingo
2018-04-25
3.3K
0
《机器学习实战》总结篇
编程算法
数据结构
前些天完成了《机器学习实战》这本书的学习,也利用 Python3 实现了各个章节的代码,对传统的机器学习方法有了更进一步的了解,这里做一个总结。 代码传送门: https://github.com/xyxxmb/Machine-Learning-In-Action 目录 第一部分:分类 【Ch1】机器学习基础 【Ch2】k - 近邻算法 【Ch3】决策树 【Ch4】基于概率论的分类方法:朴素贝叶斯 【Ch5】Logistic 回归 【Ch6】支持向量机 【Ch7】利用 AdaBoost 元算法
echobingo
2018-04-25
861
0
Q202 Happy Number
编程算法
数据结构
Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equ
echobingo
2018-04-25
497
0
Q198 House Robber
编程算法
数据结构
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security system connected and it will automatical
echobingo
2018-04-25
451
0
Q167 Two Sum II - Input array is sorted
编程算法
数据结构
Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be
echobingo
2018-04-25
414
0
Q107 Binary Tree Level Order Traversal II
编程算法
数据结构
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For example: Given binary tree [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7 return its bo
echobingo
2018-04-25
372
0
Q111 Minimum Depth of Binary Tree
编程算法
数据结构
Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node. 解题思路: 先明白最小路径的定义:从根结点到最近叶子结点的所包含的结点个数(包括根)。 举个例子: Example1: 0 return 1 Example2: 0
echobingo
2018-04-25
366
0
Q101 Symmetric Tree
编程算法
数据结构
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \ 2 2 / \ / \ 3 4 4 3 But the following [1,2,2,null,3,null,3] is not: 1 /
echobingo
2018-04-25
489
0
Q67 Add Binary
编程算法
数据结构
python
Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". 解题思路: 使用Python的内置函数 .zfill(总长度) 将 a、b两字符串补为相等的字符串,然后从后往前相加。 Python实现: class Solution: def addBinary(self, a, b): """ :type
echobingo
2018-04-25
498
0
Q20 Valid Parentheses
编程算法
数据结构
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the correct order, "()" and "()[]{}" are all valid but "(]" and "([)]" are not. 解题思路: 模拟栈的操作,如果是(、[、},则入栈;如果是
echobingo
2018-04-25
498
0
Q35 Search Insert Position
编程算法
数据结构
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You may assume no duplicates in the array. Example 1: Input: [1,3,5,6], 5 Output: 2 Example 2: Input:
echobingo
2018-04-25
528
0
Q28 Implement strStr()
编程算法
数据结构
Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: Input: haystack = "hello", needle = "ll" Output: 2 Example 2: Input: haystack = "aaaaa", needle = "bba" Output: -1 解题思路:
echobingo
2018-04-25
521
0
Q21 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: Input: 1->2->4, 1->3->4 Output: 1->1->2->3->4->4 解题思路: 创建一个新链表,包括头结点和工作结点。在比较的过程中为工作结点的后续创建新的结点,直至有一个链表为空
echobingo
2018-04-25
523
0
Q26 Remove Duplicates from Sorted Array
编程算法
数据结构
Given a sorted array, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory. Example: G
echobingo
2018-04-25
457
0
Q27 Remove Element
编程算法
数据结构
Given an array and a value, remove all instances of that value in-place and return the new length. Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory. The order of elements can be ch
echobingo
2018-04-25
608
0
Q13 Roman to Integer
python
编程算法
数据结构
Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 解题思路: 将罗马字符保存到map中,观察罗马字符的规律,编写代码。 Python实现: class Solution: def romanToInt(self, s): """ :type s: str :rtype: int
echobingo
2018-04-25
539
0
Q7 Reverse Integer
编程算法
数据结构
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 Output: 21 Note: Assume we are dealing with an environment which could only hold integers within the
echobingo
2018-04-25
523
0
Q1 Two Sum
编程算法
数据结构
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 same element twice. Example: Given nums = [2, 7, 11, 15], targ
echobingo
2018-04-25
504
0
点击加载更多
社区活动
腾讯技术创作狂欢月
“码”上创作 21 天,分 10000 元奖品池!
立即发文
Python精品学习库
代码在线跑,知识轻松学
立即查看
博客搬家 | 分享价值百万资源包
自行/邀约他人一键搬运博客,速成社区影响力并领取好礼
立即体验
技术创作特训营·精选知识专栏
往期视频·千货材料·成员作品 最新动态
立即查看
领券
问题归档
专栏文章
快讯文章归档
关键词归档
开发者手册归档
开发者手册 Section 归档