
算法相关
文章平均质量分 92
算法相关,刷题吧,刷题这件事除了从昨天开始,最好的时间就是今天;
Binbin_Sun
这个作者很懒,什么都没留下…
展开
-
NNIE的运行机制
NNIE的运行机制一:背景 由于当前主流算法中都使用了深度学习算法,而深度学习算法在移植过程中,基于带有的NNIE推理单元的Hisi芯片将极大的提高算法模型的推理,加速算法计算,从而便于算法落地上车。故而本文将简要说明NNIE的运行机制,主要包括如下部分:a:NNIE的运行机制b:单/双核NNIE的调度逻辑c:多算法并行的可能资源限制条件二: NNIE的运行机制 NNIE 是 Neural Network Inference Engine 的简称,是海思媒...原创 2022-03-07 09:42:59 · 7396 阅读 · 2 评论 -
[算法相关]973. 最接近原点的 K 个点
好久没刷题了, 搞起啊,不然脑袋要废了…https://leetcode-cn.com/problems/k-closest-points-to-origin/我们有一个由平面上的点组成的列表 points。需要从中找出 K 个距离原点 (0, 0) 最近的点。(这里,平面上两点之间的距离是欧几里德距离。)你可以按任何顺序返回答案。除了点坐标的顺序之外,答案确保是唯一的。示例 1:输入:points = [[1,3],[-2,2]], K = 1输出:[[-2,2]]解释:(1, 3) 和原创 2020-11-11 23:55:20 · 338 阅读 · 0 评论 -
[算法相关]-最长回文字符串
最长回文字符串题目描述Catcher 是MCA国的情报员,他工作时发现敌国会用一些对称的密码进行通信,比如像这些ABBA,ABA,A,123321,但是他们有时会在开始或结束时加入一些无关的字符以防止别国破解。比如进行下列变化 ABBA->12ABBA,ABA->ABAKK,123321->51233214 。因为截获的串太长了,而且存在多种可能的情况(abaaab可看作是a...原创 2020-04-12 18:58:44 · 587 阅读 · 0 评论 -
[算法相关] 118. Pascal's Triangle-杨辉三角形
杨辉三角形GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]]给定一个数,写出其杨辉三角形对应式。原创 2016-04-17 15:12:29 · 451 阅读 · 0 评论 -
[算法相关] LeetCode_198. House Robber_动态规划
198. House RobberYou 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原创 2016-01-21 12:45:01 · 865 阅读 · 0 评论 -
[算法相关] LeetCode_66. Plus One_数组加一
66. Plus OneGiven a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at the head of the list.题意:给原创 2016-01-22 21:15:25 · 512 阅读 · 0 评论 -
[算法相关] 9. Palindrome Number-数字的回文
9. Palindrome NumberDetermine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (ie, -1)If you原创 2016-04-17 22:47:32 · 554 阅读 · 0 评论 -
[算法相关] Pascal's Triangle II --杨辉三角形-链表和数组
119. Pascal's Triangle II Total Accepted:72830Total Submissions:226423Difficulty:EasyGiven an indexk, return thekthrow of the Pascal's triangle.For example, giv原创 2016-04-17 21:51:03 · 716 阅读 · 0 评论 -
[算法相关] LeetCode_66. Plus One_数组加一
66. Plus OneGiven a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at the head of the list.publ原创 2016-01-21 16:21:34 · 622 阅读 · 0 评论 -
[算法相关] LeetCode_27.Remove Element_数组去元素
27. Remove ElementGiven an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave bey原创 2016-01-19 22:16:53 · 508 阅读 · 0 评论 -
[算法相关] LeetCode_101. Symmetric Tree_对称二叉树
101. Symmetric TreeGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / \ 2 2 / \ / \3原创 2016-01-19 20:12:18 · 442 阅读 · 0 评论 -
[算法相关] LeetCode_110.Balanced Binary Tree_平衡二叉树
110. Balanced Binary TreeGiven a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two sub原创 2016-01-19 14:57:36 · 551 阅读 · 0 评论 -
[算法相关] LeetCode_Implement Queue using Stacks_队列操作
232. Implement Queue using StacksImplement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the element from in front of queue原创 2016-01-19 14:06:45 · 422 阅读 · 0 评论 -
[算法相关] LeetCode-Merge Two Sorted Lists--链接两个有序链表
21. Merge Two Sorted Lists如题,将两个有序的链表合并成一个链表,并且使其大小排列是从小到大。原创 2016-01-18 21:16:05 · 428 阅读 · 0 评论 -
[算法相关] LeetCode_HappyNumber_哈希表的使用
202. Happy NumberWrite 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原创 2016-01-15 19:56:52 · 621 阅读 · 0 评论 -
[算法相关] LeetCode_Ugly Number_ 丑陋的数字
给定一个数,判断其是否为‘丑数’,这里丑数的定义为,其分解质因数是含有非2,3,5之外的其他数。特别的,1是一个丑数。原创 2016-01-15 10:03:09 · 1298 阅读 · 0 评论 -
[算法相关] LeetCode_Climbing Stairs--爬楼梯
70. Climbing Stairs如题,n阶楼梯每次爬一层或是两层,多少种方式能到n层??原创 2016-01-14 22:29:26 · 437 阅读 · 0 评论 -
[算法相关] Leetcode—三的幂
326. Power of ThreeGiven an integer, write a function to determine if it is a power of three.Follow up:Could you do it without using any loop / recursion?如题,给定一个数,判定其是否是3的幂。注意不要用循环来解。原创 2016-01-14 14:44:30 · 568 阅读 · 0 评论 -
[算法相关] Lowest Common Ancestor of a Binary Search Tree
235. Lowest Common Ancestor of a Binary Search TreeGiven a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to thedefinition of LCA on原创 2016-01-13 10:29:08 · 422 阅读 · 0 评论 -
[算法相关] Leetcode——Contains Duplicate
217. Contains DuplicateGiven an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should retur原创 2016-01-12 11:18:51 · 463 阅读 · 0 评论 -
[算法相关] leetcode_Excel Sheet Column Number
171. Excel Sheet Column NumberRelated to questionExcel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For example:A ->原创 2016-01-12 11:18:48 · 465 阅读 · 0 评论 -
[算法相关] Leetcode——valid Anagram——时间复杂度太高,怎么办??
242. Valid AnagramTotal Accepted:49956Total Submissions:125369Difficulty:EasyGiven two stringssandt, write a function to determine iftis an anagram ofs.For example,s=原创 2016-01-12 11:18:46 · 545 阅读 · 0 评论 -
[算法相关] LeetCode_SameTree
100. Same TreeTotal Accepted:102505Total Submissions:241539Difficulty:EasyGiven two binary trees, write a function to check if they are equal or not.Two binary trees are con原创 2016-01-12 11:18:44 · 376 阅读 · 0 评论 -
[算法相关] LeetCode_ Invert Binary Tree
226. Invert Binary TreeTotal Accepted:60170Total Submissions:140987Difficulty:EasyInvert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \原创 2016-01-12 11:18:41 · 371 阅读 · 0 评论 -
[算法相关] leetCode_Move Zeroes_
为了保证在不需要Leetcode的情况下也可以运行,我写了测试用例,希望在线下也可以用:283. Move ZeroesTotal Accepted:44440Total Submissions:103965Difficulty:EasyGiven an arraynums, write a function to mov原创 2016-01-12 11:18:39 · 489 阅读 · 0 评论 -
[算法相关] Leetcode__Maximum depth
104. Maximum Depth of Binary TreeTotal Accepted:111336Total Submissions:238298Difficulty:EasyGiven a binary tree, find its maximum depth.The maximum depth is the number of原创 2016-01-12 11:18:34 · 527 阅读 · 0 评论 -
[算法相关] LeetCode_237. Delete Node in a Linked List
237. Delete Node in a Linked ListTotal Accepted:53467Total Submissions:121930Difficulty:EasyWrite a function to delete a node (except the tail) in a singly linked list, given原创 2016-01-12 11:18:36 · 674 阅读 · 0 评论 -
[算法相关] LeetCode__Add Digits
今天的第二题:Add DigitsGiven a non-negative integernum, repeatedly add all its digits until the result has only one digit.For example:Givennum = 38, the process is like:3 + 8 = 11,原创 2016-01-12 11:18:31 · 455 阅读 · 0 评论 -
[算法相关] LeetCode——Nim Game
这是第二天的的编码,题目如下:. Nim GameTotal Accepted:30590Total Submissions:60866Difficulty:EasyYou are playing the following Nim Game with your friend: There is a heap of stones o原创 2016-01-12 11:18:29 · 574 阅读 · 0 评论 -
[算法相关] LeeCode_MultiplyStrings
经过昨天一天,还有今天的学习,终于是把第一个程序给搞出来,虽然是借鉴他人的,但是还是收获颇多。现在把这个程序的问题,和解决方案在下面贴出:MultiplyStringsGiven two numbers represented as strings, return multiplication of the numbers as a string.Note: T原创 2016-01-12 11:18:26 · 682 阅读 · 0 评论 -
[算法相关] 260. Single Number III -取出非重复数字(加强版)
260. Single Number IIIGiven an array of numbersnums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear o原创 2016-05-04 22:41:21 · 569 阅读 · 0 评论 -
[算法相关] 136. Single Number--取出非重复数字
136. Single NumberGiven an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you imp原创 2016-05-04 22:37:05 · 638 阅读 · 0 评论 -
[算法相关] Valid Sudoku-数独判断
Determine if a Sudoku is valid, according to:Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with the character'.'.A partially fil原创 2016-05-03 16:00:48 · 516 阅读 · 0 评论 -
[算法相关] Minimum Depth of Binary Tree
111. Minimum Depth of Binary TreeGiven 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原创 2016-04-29 15:01:10 · 435 阅读 · 0 评论 -
[算法相关] Path Sum-二叉树相加之和
链接:https://leetcode.com/problems/path-sum/Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo原创 2016-04-28 23:14:52 · 1182 阅读 · 0 评论 -
[算法相关] Leetcode—— Number of 1 Bits——最简单的一题
191. Number of 1 BitsWrite a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight).For example, the 32-bit integer ’11' has b原创 2016-01-11 22:12:57 · 576 阅读 · 0 评论 -
[算法相关] LeetCode_206. Reverse Linked List-翻转链表
206. Reverse Linked ListMy SubmissionsQuestionTotal Accepted:73458Total Submissions:198280Difficulty:EasyReverse a singly linked list.如题,将一个链表进行翻转。例如初始的是[1-2-3-4-5-6]原创 2016-01-13 20:34:41 · 469 阅读 · 0 评论