自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Learning from the mistakes

我问佛∶世间为何有那麽多遗憾? 佛曰∶这是一个婆娑世界,婆娑既遗憾, 没有遗憾,给你再多幸福也不会体会快乐。

  • 博客(97)
  • 资源 (13)
  • 问答 (1)
  • 收藏
  • 关注

原创 [leetcode] 450. 删除二叉搜索树中的节点

Description给定一个二叉搜索树的根节点 root 和一个值 key,删除二叉搜索树中的 key 对应的节点,并保证二叉搜索树的性质不变。返回二叉搜索树(有可能被更新)的根节点的引用。一般来说,删除节点可分为两个步骤:首先找到需要删除的节点;如果找到了,删除它。说明: 要求算法时间复杂度为 O(h),h 为树的高度。示例:root = [5,3,6,2,4,null,7]key = 3 5 / \ 3 6 / \ \2 4 7给定需要删除的

2020-09-28 17:33:51 244 1

原创 python 堆排序

最近在预习算法,这里把堆排序也预习一下,哈哈。分享给大家。最核心的是构建大顶堆的过程。按照堆的特点可以把堆分为大顶堆和小顶堆大顶堆:每个结点的值都大于或等于其左右孩子结点的值小顶堆:每个结点的值都小于或等于其左右孩子结点的值代码class Solution(): def __init__(self): super().__init__() def adjust(self,arr,n,i): largest=i l=2*i+1

2020-09-27 13:01:35 121

原创 python 归并排序

用python实现了一下归并排序,发现还真有点记不住了,所以写完了之后梳理一下,分享给大家。代码class Solution(): def __init__(self): super().__init__() def merge(self,arr1,arr2): i,j=0,0 m=len(arr1) n=len(arr2) res=[] while(i<m and j<

2020-09-27 10:43:59 128

原创 python 快速排序

以前又个面试官叫我写快速排序,我写了半个小时才写出来,中间还有bug,这里我复习一遍,用python实现一下,希望能对别人有所启发。代码class Solution(): def __init__(self): super().__init__() def partition(self,arr,low,high): key=arr[low] while(low<high): while(low<

2020-09-27 09:40:32 113

原创 [leetcode] 103. 二叉树的锯齿形层次遍历

Description给定一个二叉树,返回其节点值的锯齿形层次遍历。(即先从左往右,再从右往左进行下一层遍历,以此类推,层与层之间交替进行)。例如:给定二叉树 [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7返回锯齿形层次遍历如下:[ [3], [20,9], [15,7]]分析题目的意思是:这道题要用队列来实现,偶数层按照从左到右排列,奇数层按照从右到左排列就行了。代码# Definition

2020-09-27 00:21:28 133

原创 [leetcode] 1. 两数之和

Description给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。你可以假设每种输入只会对应一个答案。但是,数组中同一个元素不能使用两遍。示例:给定 nums = [2, 7, 11, 15], target = 9因为 nums[0] + nums[1] = 2 + 7 = 9所以返回 [0, 1]分析题目的意思是:给定数组中两数之和等于target的坐标,我一开始想到了双循环暴力破解,后面发现也可以用字典

2020-09-26 23:50:04 84

原创 [leetcode] 剑指 Offer 56 - I. 数组中数字出现的次数

Description一个整型数组 nums 里除两个数字之外,其他数字都出现了两次。请写程序找出这两个只出现一次的数字。要求时间复杂度是O(n),空间复杂度是O(1)。示例 1:输入:nums = [4,1,4,6]输出:[1,6] 或 [6,1]示例 2:输入:nums = [1,2,10,4,1,4,3,3]输出:[2,10] 或 [10,2]限制:2 <= nums.length <= 10000分析题目的意思是:给定一个数组,其中有两个数的频率只有一次,要

2020-09-26 23:41:17 114

原创 [leetcode] 102. 二叉树的层序遍历

Description给你一个二叉树,请你返回其按 层序遍历 得到的节点值。 (即逐层地,从左到右访问所有节点)。示例:二叉树:[3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7返回其层次遍历结果:[ [3], [9,20], [15,7]]分析题目的意思是:这道题要用队列来实现,以前用C++实现过一次,用python还写了几个bug,哈哈哈,看来不复习迟早会出事。代码# Definition

2020-09-26 23:23:17 145

原创 [leetcode] 112. 路径总和

Description给定一个二叉树和一个目标和,判断该树中是否存在根节点到叶子节点的路径,这条路径上所有节点值相加等于目标和。说明: 叶子节点是指没有子节点的节点。示例:给定如下二叉树,以及目标和 sum = 22, 5 / \ 4 8 / / \ 11 13 4 / \ \ 7 2 1返回 true

2020-09-26 23:05:33 83 1

原创 [leetcode] 23. 合并K个升序链表

Description给你一个链表数组,每个链表都已经按升序排列。请你将所有链表合并到一个升序链表中,返回合并后的链表。示例 1:输入:lists = [[1,4,5],[1,3,4],[2,6]]输出:[1,1,2,3,4,4,5,6]解释:链表数组如下:[ 1->4->5, 1->3->4, 2->6]将它们合并到一个有序链表中得到。1->1->2->3->4->4->5->6示例 2:输入:

2020-09-26 22:47:13 97 1

原创 [leetcode] 160. 相交链表

Description编写一个程序,找到两个单链表相交的起始节点。如下面的两个链表:在节点 c1 开始相交。示例 1:输入:intersectVal = 8, listA = [4,1,8,4,5], listB = [5,0,1,8,4,5], skipA = 2, skipB = 3输出:Reference of the node with value = 8输入解释:相交节点的值为 8 (注意,如果两个链表相交则不能为 0)。从各自的表头开始算起,链表 A 为 [4,1,8,4,5]

2020-09-26 22:17:56 79 1

原创 [leetcode] 145. 二叉树的后序遍历

Description给定一个二叉树,返回它的 后序 遍历。示例:Example 1:输入: [1,null,2,3] 1 \ 2 / 3 输出: [3,2,1]进阶: 递归算法很简单,你可以通过迭代算法完成吗?分析题目的意思是:实现二叉树的后续遍历,没什么说的,需要用到栈,首先把根节点加入到栈,然后遍历栈,拓展左右子节点,然后不断的取出值进行拓展。最后输出的结果是output的逆序。从上到下,从右到左,逆序就是从左到右,从下到上,刚好是后序遍历

2020-09-26 22:01:39 71

原创 [leetcode] 1385. Find the Distance Value Between Two Arrays

DescriptionGiven two integer arrays arr1 and arr2, and the integer d, return the distance value between the two arrays.The distance value is defined as the number of elements arr1[i] such that there is not any element arr2[j] where |arr1[i]-arr2[j]| <

2020-09-25 22:29:53 176

原创 [leetcode] 1366. Rank Teams by Votes

DescriptionIn a special ranking system, each voter gives a rank from highest to lowest to all teams participated in the competition.The ordering of teams is decided by who received the most position-one votes. If two or more teams tie in the first positi

2020-09-25 19:22:15 305

原创 [leetcode] 1365. How Many Numbers Are Smaller Than the Current Number

DescriptionGiven the array nums, for each nums[i] find out how many numbers in the array are smaller than it. That is, for each nums[i] you have to count the number of valid j’s such that j != i and nums[j] < nums[i].Return the answer in an array.Exa

2020-09-25 00:29:58 150

原创 [leetcode] 1352. Product of the Last K Numbers

DescriptionImplement the class ProductOfNumbers that supports two methods:add(int num)Adds the number num to the back of the current list of numbers.getProduct(int k)Returns the product of the last k numbers in the current list.You can assume

2020-09-24 23:37:38 238

原创 [leetcode] 1351. Count Negative Numbers in a Sorted Matrix

DescriptionGiven a m * n matrix grid which is sorted in non-increasing order both row-wise and column-wise.Return the number of negative numbers in grid.Example 1:Input: grid = [[4,3,2,-1],[3,2,1,-1],[1,1,-1,-2],[-1,-1,-2,-3]]Output: 8Explanation: Th

2020-09-24 23:13:35 180

原创 [leetcode] 1346. Check If N and Its Double Exist

DescriptionGiven an array arr of integers, check if there exists two integers N and M such that N is the double of M ( i.e. N = 2 * M).More formally check if there exists two indices i and j such that :i != j0 <= i, j < arr.lengtharr[i] == 2 *

2020-09-24 19:42:26 214

原创 [leetcode] 1338. Reduce Array Size to The Half

DescriptionGiven an array arr. You can choose a set of integers and remove all the occurrences of these integers in the array.Return the minimum size of the set so that at least half of the integers of the array are removed.Example 1:Input: arr = [3,3

2020-09-24 19:25:38 166

原创 [leetcode] 1337. The K Weakest Rows in a Matrix

DescriptionGiven a m * n matrix mat of ones (representing soldiers) and zeros (representing civilians), return the indexes of the k weakest rows in the matrix ordered from the weakest to the strongest.A row i is weaker than row j, if the number of soldie

2020-09-24 13:48:01 189

原创 [leetcode] 1333. Filter Restaurants by Vegan-Friendly, Price and Distance

DescriptionGiven the array restaurants where restaurants[i] = [idi, ratingi, veganFriendlyi, pricei, distancei]. You have to filter the restaurants using three filters.The veganFriendly filter will be either true (meaning you should only include restaur

2020-09-24 13:32:11 252

原创 [leetcode] 1343. Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold

DescriptionGiven an array of integers arr and two integers k and threshold.Return the number of sub-arrays of size k and average greater than or equal to threshold.Example 1:Input: arr = [2,2,2,2,5,5,5,8], k = 3, threshold = 4Output: 3Explanation: Su

2020-09-24 00:17:34 127

原创 [leetcode] 1304. Find N Unique Integers Sum up to Zero

DescriptionGiven an integer n, return any array containing n unique integers such that they add up to 0.Example 1:Input: n = 5Output: [-7,-1,1,3,4]Explanation: These arrays also are accepted [-5,-1,1,2,3] , [-3,-1,2,-2,4].Example 2:Input: n = 3Out

2020-09-23 22:20:46 142

原创 [leetcode] 1296. Divide Array in Sets of K Consecutive Numbers

DescriptionGiven an array of integers nums and a positive integer k, find whether it’s possible to divide this array into sets of k consecutive numbersReturn True if its possible otherwise return False.Example 1:Input: nums = [1,2,3,3,4,4,5,6], k = 4O

2020-09-23 21:42:15 188

原创 [leetcode] 1295. Find Numbers with Even Number of Digits

DescriptionGiven an array nums of integers, return how many of them contain an even number of digits.Example 1:Input: nums = [12,345,2,6,7896]Output: 2Explanation: 12 contains 2 digits (even number of digits). 345 contains 3 digits (odd number of di

2020-09-23 20:52:23 206

原创 [leetcode] 1292. Maximum Side Length of a Square with Sum Less than or Equal to Threshold

DescriptionGiven a m x n matrix mat and an integer threshold. Return the maximum side-length of a square with a sum less than or equal to threshold or return 0 if there is no such square.Example 1:Input: mat = [[1,1,3,2,4,3,2],[1,1,3,2,4,3,2],[1,1,3,2,4

2020-09-23 19:43:35 180

原创 [leetcode] 1277. Count Square Submatrices with All Ones

DescriptionGiven a m * n matrix of ones and zeros, return how many square submatrices have all ones.Example 1:Input: matrix =[ [0,1,1,1], [1,1,1,1], [0,1,1,1]]Output: 15Explanation: There are 10 squares of side 1.There are 4 squares of side

2020-09-23 18:55:04 146

原创 [leetcode] 1275. Find Winner on a Tic Tac Toe Game

DescriptionTic-tac-toe is played by two players A and B on a 3 x 3 grid.Here are the rules of Tic-Tac-Toe:Players take turns placing characters into empty squares (" ").The first player A always places “X” characters, while the second player B always

2020-09-22 23:00:53 256

原创 [leetcode] 1267. Count Servers that Communicate

DescriptionYou are given a map of a server center, represented as a m * n integer matrix grid, where 1 means that on that cell there is a server and 0 means that it is no server. Two servers are said to communicate if they are on the same row or on the sa

2020-09-22 20:05:15 106

原创 [leetcode] 1266. Minimum Time Visiting All Points

DescriptionOn a plane there are n points with integer coordinates points[i] = [xi, yi]. Your task is to find the minimum time in seconds to visit all points.You can move according to the next rules:In one second always you can either move vertically, h

2020-09-22 19:21:58 106

原创 [leetcode] 1260. Shift 2D Grid

DescriptionGiven a 2D grid of size m x n and an integer k. You need to shift the grid k times.In one shift operation:Element at grid[i][j] moves to grid[i][j + 1].Element at grid[i][n - 1] moves to grid[i + 1][0].Element at grid[m - 1][n - 1] moves t

2020-09-22 13:55:41 158

原创 [leetcode] 1252. Cells with Odd Values in a Matrix

DescriptionGiven n and m which are the dimensions of a matrix initialized by zeros and given an array indices where indices[i] = [ri, ci]. For each pair of [ri, ci] you have to increment all cells in row ri and column ci by 1.Return the number of cells w

2020-09-22 13:34:41 127

原创 [leetcode] 1233. Remove Sub-Folders from the Filesystem

DescriptionGiven a list of folders, remove all sub-folders in those folders and return in any order the folders after removing.If a folder[i] is located within another folder[j], it is called a sub-folder of it.The format of a path is one or more concat

2020-09-22 00:02:51 182

原创 [leetcode] 1232. Check If It Is a Straight Line

DescriptionYou are given an array coordinates, coordinates[i] = [x, y], where [x, y] represents the coordinate of a point. Check if these points make a straight line in the XY plane.Example 1:Input: coordinates = [[1,2],[2,3],[3,4],[4,5],[5,6],[6,7]]Ou

2020-09-21 23:27:37 154

原创 [leetcode] 1222. Queens That Can Attack the King

DescriptionOn an 8x8 chessboard, there can be multiple Black Queens and one White King.Given an array of integer coordinates queens that represents the positions of the Black Queens, and a pair of coordinates king that represent the position of the White

2020-09-21 22:46:25 137

原创 [leetcode] 1217. Minimum Cost to Move Chips to The Same Position

DescriptionWe have n chips, where the position of the ith chip is position[i].We need to move all the chips to the same position. In one step, we can change the position of the ith chip from position[i] to:position[i] + 2 or position[i] - 2 with cost =

2020-09-21 19:35:15 306

原创 [leetcode] 1208. Get Equal Substrings Within Budget

DescriptionYou are given two strings s and t of the same length. You want to change s to t. Changing the i-th character of s to i-th character of t costs |s[i] - t[i]| that is, the absolute difference between the ASCII values of the characters.You are al

2020-09-21 19:13:06 164

原创 [leetcode] 1202. Smallest String With Swaps

DescriptionYou are given a string s, and an array of pairs of indices in the string pairs where pairs[i] = [a, b] indicates 2 indices(0-indexed) of the string.You can swap the characters at any pair of indices in the given pairs any number of times.Retu

2020-09-20 23:03:33 190

原创 [leetcode] 1200. Minimum Absolute Difference

DescriptionGiven an array of distinct integers arr, find all pairs of elements with the minimum absolute difference of any two elements.Return a list of pairs in ascending order(with respect to pairs), each pair [a, b] followsa, b are from arra < b

2020-09-20 20:39:29 153

原创 [leetcode] 1550. Three Consecutive Odds

DescriptionGiven an integer array arr, return true if there are three consecutive odd numbers in the array. Otherwise, return false.Example 1:Input: arr = [2,6,4,1]Output: falseExplanation: There are no three consecutive odds.Example 2:Input: arr =

2020-09-20 18:57:36 217

StegoShare.jar.zip

一个小工具,可以隐藏文件到某文件中,也可以从某文件中提取该文件

2021-05-24

openfst-1.6.7.tar.gz

编译ctcdecode所需要的第三方库,下载地址为:https://sites.google.com/site/openfst/home/openfst-down/openfst-1.6.7.tar.gz

2020-05-06

RotateDemo.rar

QT5版本的旋转图片的动画,编译器用的mingW,代码进行了重构改良,文章请参考: https://blog.csdn.net/w5688414/article/details/90072287

2019-05-10

springboot getopenid demo

springboot实现用户信息授权获取用户的id, 写的教程地址为https://blog.csdn.net/w5688414/article/details/88541743

2019-03-13

pytorch 0.3.1 python3.6 CPU版本whl

pytorch 0.3.1 python3.6 CPU版本whl,这个属于老版本了,在官网上都不容易找到,我这里分享出来

2019-03-11

NUS-WIDE多标签分类数据集整理

博客地址为:https://blog.csdn.net/w5688414/article/details/84593705 用keras进行多标签分类的图片数据集,图片取自于NUS-WIDE数据集

2018-11-29

VGG_ILSVRC_16_layers_fc_reduced.h5

VGG_ILSVRC_16_layers_fc_reduced.h5文件,用于ssd keras模型,考虑到国内没有搜到该资源,我来当当搬运工

2018-11-07

Jetson-TX2 tensorflow-1.3.0-cp35-cp35m-linux_aarch64.whl

最近编译成功了tensorflow 1.3的版本,tensorflow-1.3.0-cp35-cp35m-linux_aarch64.whl,把编译成功的文件分享给大家

2017-12-25

bazel-0.6.1-dist.zip 下载

官网地址为:https://github.com/bazelbuild/bazel/releases/,但是很难下载下来,我用的是校园网,都下了好久,我把我下载的包分享给大家,希望对大家有用

2017-11-15

Connectionist Temporal Classification: A Tutorial with Gritty Details

教程:Connectionist Temporal Classification详解补充中文翻译的对应的英文原版教程,链接为:http://blog.csdn.net/w5688414/article/details/77867786,希望能帮助到大家

2017-09-14

操作系统页面置换LRU,FIFO,OPT算法实现代码

LRU算法,FIFO算法,OPT算法,belady现象

2015-01-05

异步框架上传客户端示例

android异步框架应用的一个小小的示例

2014-09-16

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

TA关注的人

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