- 博客(280)
- 资源 (7)
- 收藏
- 关注
原创 <LeetCode OJ> 374. Guess Number Higher or Lower
We are playing the Guess Game. The game is as follows:I pick a number from 1 to n. You have to guess which number I picked.Every time you guess wrong, I'll tell you whether the number is higher
2016-07-14 21:16:35 2637
原创 <LeetCode OJ> 371. Sum of Two Integers
Total Accepted: 3722 Total Submissions: 6898 Difficulty: EasyCalculate the sum of two integers a and b, but you are not allowed to use the operator + and -.Example:Given a = 1 and b =
2016-07-02 18:25:10 1862
原创 <LeetCode OJ> 241. Different Ways to Add Parentheses
Total Accepted: 23674 Total Submissions: 65569 Difficulty: MediumGiven a string of numbers and operators, return all possible results from computing all the different possible ways to grou
2016-06-16 09:16:57 2010
原创 <LeetCode OJ> 334. Increasing Triplet Subsequence
Total Accepted: 16003 Total Submissions: 46481 Difficulty: MediumGiven an unsorted array return whether an increasing subsequence of length 3 exists or not in the array.Formally the func
2016-06-14 20:20:17 1116
原创 <LeetCode OJ> 318. Maximum Product of Word Lengths
Total Accepted: 23617 Total Submissions: 58995 Difficulty: MediumGiven a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share
2016-06-13 20:31:51 2509
原创 <LeetCode OJ> 173. Binary Search Tree Iterator
Total Accepted: 50775 Total Submissions: 144066 Difficulty: MediumImplement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Cal
2016-06-13 19:35:59 1152
原创 <LeetCode OJ> 357. Count Numbers with Unique Digits
Total Accepted: 450 Total Submissions: 1077 Difficulty: MediumGiven a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x n.Example:Given n = 2, return 91. (Th
2016-06-13 17:26:10 1591
原创 <LeetCode OJ> 60. Permutation Sequence
Total Accepted: 56468 Total Submissions: 221337 Difficulty: MediumThe set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in orde
2016-06-12 22:57:23 1368
原创 <LeetCode OJ> 114. Flatten Binary Tree to Linked List
Total Accepted: 84864 Total Submissions: 270352 Difficulty: MediumGiven a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5
2016-06-12 17:57:40 1352
原创 <LeetCode OJ> 201. Bitwise AND of Numbers Range
Total Accepted: 35859 Total Submissions: 115817 Difficulty: MediumGiven a range [m, n] where 0 For example, given the range [5, 7], you should return 4.Credits:Special thanks to @amr
2016-06-12 11:06:00 1142
原创 数字图像处理,一种简单的颜色平衡算法
对于黯淡的彩色图像调节效果.........对于暗淡图像的调节,灰度直方图基本均匀碾平:对于过度饱和图像的效果,右上角展示了直返图的效果,可以看见基本均匀碾平了:参考代码:#include "string"#include "vector"#include #include #include //opencv_no
2016-06-11 21:47:19 6753 1
原创 <LeetCode OJ> 200 / 130 Number of Islands / Surrounded Regions
Total Accepted: 48411 Total Submissions: 171609 Difficulty: MediumGiven a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and
2016-06-11 16:36:36 1462
原创 <LeetCode OJ> 48. Rotate Image
Total Accepted: 69879 Total Submissions: 199786 Difficulty: MediumYou are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could yo
2016-06-05 16:27:07 2204
原创 <LeetCode OJ> 54 / 59 Spiral Matrix( I / II )
Total Accepted: 61182 Total Submissions: 268396 Difficulty: MediumGiven a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example,Gi
2016-06-04 18:05:45 1228
原创 <LeetCode OJ> 106. Construct Binary Tree from Inorder and Postorder Traversal
Total Accepted: 56569 Total Submissions: 193357 Difficulty: MediumGiven inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not
2016-06-03 22:43:25 1129
原创 <LeetCode OJ> 105. Construct Binary Tree from Preorder and Inorder Traversal
Total Accepted: 65143 Total Submissions: 224882 Difficulty: MediumGiven preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not e
2016-06-03 18:08:36 1333
原创 <LeetCode OJ> 109 / 108 Convert Sorted ( List / Array ) to Binary Search Tree
Total Accepted: 71642 Total Submissions: 233074 Difficulty: MediumGiven a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.Subscri
2016-06-02 21:48:27 1130
原创 LeetCode总结,回溯法小结
一,回溯法思想回溯法概念 回溯算法实际上一个类似枚举的搜索尝试过程,主要是在搜索尝试过程中寻找问题的解,当发现已不满足求解条件时,就“回溯”返回,尝试别的路径。 回溯法是一种选优搜索法,按选优条件向前搜索,以达到目标。但当探索到某一步时,发现原先选择并不优或达不到目标,就退回一步重新选择,这种走不通就退回再走的技术为回溯法,而满足回溯条件的某个状态
2016-06-02 21:31:15 16919 2
原创 <LeetCode OJ> 319. Bulb Switcher
Total Accepted: 20000 Total Submissions: 48830 Difficulty: MediumThere are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the thi
2016-06-02 09:00:07 1114
原创 <LeetCode OJ> 223. Rectangle Area
Total Accepted: 38216 Total Submissions: 126941 Difficulty: EasyFind the total area covered by two rectilinear rectangles in a 2D plane.Each rectangle is defined by its bottom left corne
2016-05-31 15:57:41 1101
原创 数字图像处理,叠加平均去噪与小波阈值去噪的对比
叠加平均对于随机噪声具有非常强的去噪能力,本文简单对比了与小波阈值去噪算法的优劣。叠加平均去噪:反复对同一张干净的图像添加随机噪声(椒盐,乘性,高斯等噪声),进行叠加平均。小波阈值去噪:利用改进了阈值的小波阈值去噪对图像进行去噪处理,其中半阈值是改进了的阈值函数。图像信息:经典的lena图,大小256*2561,添加'speckle'噪声时,两种算法的去砸效果对比
2016-05-29 16:12:26 10587 4
原创 LeetCode总结,二叉树各种类型问题小结
1,三大基础遍历方式三个遍历的博客地址,1)<LeetCode OJ> 144/145/94 Binary Tree (Pre & In & Post) order Traversal即:前序遍历,总是先访问当前节点,再左子,最后右子中序遍历,总是先访问左子,再当前节点,最后右子后序遍历,总是先访问左子,再右子,最后当前节点关于三
2016-05-24 10:49:23 5933 1
原创 <LeetCode OJ> 349 / 350 Intersection of Two Arrays(I / II)
Total Accepted: 3212 Total Submissions: 6814 Difficulty: EasyGiven two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], retu
2016-05-20 00:07:47 2229 1
原创 <LeetCode OJ> 61 / 86 Rotate List / Partition List
Total Accepted: 69038 Total Submissions: 300765 Difficulty: MediumGiven 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
2016-05-16 09:13:21 1096
原创 <LeetCode OJ> 347. Top K Frequent Elements
Total Accepted: 2605 Total Submissions: 5933 Difficulty: MediumGiven a non-empty array of integers, return the k most frequent elements.For example,Given [1,1,1,2,2,3] and k = 2, retur
2016-05-04 18:31:59 3183 2
原创 <LeetCode OJ> 160. Intersection of Two Linked Lists
Total Accepted: 72363 Total Submissions: 239177 Difficulty: EasyWrite a program to find the node at which the intersection of two singly linked lists begins.For example, the following
2016-05-01 23:24:43 4579 2
原创 <LeetCode OJ> 89. Gray Code
Total Accepted: 59678 Total Submissions: 164093 Difficulty: MediumThe gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer
2016-05-01 14:39:06 1822
原创 数字图像处理,相位相关算法解决图像的刚性平移问题
参考论文中的文字:图像配准是图像处理的基本任务之一,用于将不同时间、不同传感器、不同视角及不同拍摄条件下获取的关于同一目标或场景的两幅或多幅图像进行主要是几何意义上的匹配套和的过程。在对图像配准的研究过程中,大量技术被应用于针对不同数据和问题的图像配准工作,产生了多种不同形式的图像配准技术。图像配准的基本问题是找出一种图像转换方法,用以纠正图像的形变。造成图像形变的原因多种多样,例如对于遥
2016-04-30 18:15:02 24257 19
原创 数字图像处理,图像配准SIFT算法 (Lowe的代码)
PS:1,本文博客的代码分析自:SIFT算法的“始作俑者”-----lowe,2,网址为:http://www.cs.ubc.ca/~lowe/keypoints/3,下面的代码均来自于他的1 共有三段Matlab代码源文件match.m:测试程序功能:该函数读入两幅(灰度)图像,找出各自的 SIFT 特征, 并显示两连接两幅图像中被匹配的特征点(关键特征点(t
2016-04-24 21:38:45 13525 2
原创 数字图像处理,相位相关算法解决一维信号的偏移问题
基本原理的实现其实和二维差不多,http://blog.csdn.net/ebowtang/article/details/51287309参考代码:#include #include #include #include using namespace std;/** \brief PhaseCorrelation1D compute the off
2016-04-24 10:59:27 5356 1
原创 LeetCode总结,位运算总结
对于位运算面试问题,其实我觉得是最不好处理的一类问题,原因在于他的技巧性和规律性太强,往往需要根据若干种基本运算规则(见下面)及其组合达到特定目的运算,难就难在技巧性。本文罗列了几种常见的位运算面试问题。一,位运算基础知识C++中位运算基本符号:~ | & ^ > ! 其中 !和 ~ 是不同的。基本的位操作符有与、或、非,异或、同或、取反
2016-04-23 23:01:04 3673
原创 <LeetCode OJ> 345 / 344 Reverse Vowels of a String / Reverse String
Total Accepted: 537 Total Submissions: 1488 Difficulty: EasyWrite a function that takes a string as input and reverse only the vowels of a string.Example 1:Given s = "hello", return "h
2016-04-23 20:35:46 5183
原创 2016华为软件精英挑战赛:高级案例---贪心策略(二)
一,算法设计思想:实际上本算法是对期初算法思想的优化,主要的优化就在于我们不在盲目的寻找两个必经点的路径,而是总是寻找距离最近的必经点作为新起点去寻找下一个最近的必经点.......然而这样做还不够呢!1,基于贪心思想的算法在未把所有必经点访问完之前,终点是禁止访问的。1)已起点作为“当前原点”,用Dijkstra算法将“当前原点”作为起点,找到起点
2016-04-22 14:38:14 4339 3
原创 2016华为软件精英挑战赛:初期算法设计方案及其代码实现
注:此算法存在诸多问题,无法解决规模比较大的案例。算法设计步骤:第一步:建图(邻接矩阵):运用官方提供的函数接口实现读取,图的建立自己实现。1) 有一个特殊情况:根据说明3,如果顶点A到达B有多条边,总是取最小边建图,其他重复的边舍去(因为我们一定不会选择大的边,并且邻接矩阵也无法存储两点间多条边)。有向图的建立,http://jingyan.baidu.com/artic
2016-04-21 20:52:47 5663
原创 <LeetCode OJ> 343. Integer Break
Total Accepted: 2481 Total Submissions: 5881 Difficulty: MediumGiven a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integer
2016-04-21 17:11:47 2026
原创 2016华为软件精英挑战赛:低级案例---暴力出奇迹(一)
比赛今天截止,最终只得了71分左右(稍微有点点波动),距离最后一名12分,厉害的人真多啊,你们是我前进的动力!
2016-04-11 18:54:35 4844 2
原创 <LeetCode OJ> 338. Counting Bits
Total Accepted: 7119 Total Submissions: 12947 Difficulty: MediumGiven a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their
2016-03-26 12:12:37 1304
原创 <LeetCode OJ> 337. House Robber III
Total Accepted: 1341 Total Submissions: 3744 Difficulty: MediumThe thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." B
2016-03-14 23:41:39 2446 3
原创 <LeetCode OJ> 39 / 40 / 216 Combination Sum(I / II / III)
Total Accepted: 83289 Total Submissions: 274461 Difficulty: MediumGiven a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numb
2016-03-11 09:11:42 1637
原创 <LeetCode OJ> 274 / 275 H-Index(I / II)
Total Accepted: 37719 Total Submissions: 125936 Difficulty: MediumGiven an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the res
2016-03-10 20:17:19 1349
使用NSIS制作的多功能工具,有利于定位问题,辅助解决问题
2022-03-07
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人