- 博客(20)
- 资源 (2)
- 收藏
- 关注
原创 LeetCode 27:Remove Element
Given 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 beyond the new length.#
2015-11-30 22:16:10 593
原创 LeetCode 26: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 in place with
2015-11-28 16:54:22 551
原创 LeetCode 25:Reverse Nodes in k-Group
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is
2015-11-28 00:48:42 649
原创 单链表的头结点和头指针
当链表的每个结点只包含一个指针域时,此链表就是单链表。在单链表的开始结点之前附设一个类型相同的结点,称之为头结点。头结点的数据域可以不存储任何信息,头结点的指针域存储指向开始结点的指针(即第一个元素结点的存储位置)。头指针是指向第一个结点的指针,链表中可以没有头结点,但是不能没有头指针。头结点的作用:1、防止单链表是空的而设的.当链表为空的时候,带头结点的头指针就指
2015-11-27 17:07:50 9373 1
原创 LeetCode 58:Length of Last Word
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word does not exist, return 0.Note: A word is
2015-11-27 16:11:54 716
原创 LeetCode 24:Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant space. Y
2015-11-25 23:54:57 669
原创 压缩感知——沃尔什-哈达玛(WHT)变换与逆变换的Matlab代码实现
沃尔什-哈达玛变换(Walsh-Hadmard Transform,WHT),是一种典型的非正弦函数变换,采用正交直角函数作为基函数,具有与傅里叶函数类似的性质,图像数据越是均匀分布,经过沃尔什-哈达玛变换后的数据越是集中于矩阵的边角上,因此沃尔什变换具有能量集中的性质,可以用于压缩图像信息。Matlab中的Hadamard函数:格式:H=hadamard( n ) ,返回一个 n * n
2015-11-25 16:48:14 29736 8
原创 LeetCode23:Merge k Sorted Lists
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity./*** Definition for singly-linked list.* struct ListNode {* int val;* ListNode *next;
2015-11-23 12:27:16 691
原创 Python实现K-means聚类
kmeans是最简单的聚类算法之一,但是运用十分广泛。最近在工作中也经常遇到这个算法。kmeans一般在数据分析前期使用,选取适当的k,将数据分类后,然后分类研究不同聚类下数据的特点。kmeans算法步骤:1 随机选取k个中心点2 遍历所有数据,将每个数据划分到最近的中心点中3 计算每个聚类的平均值,并作为新的中心点4 重复2-3,直到这k个中线点不再变
2015-11-21 17:19:31 2985
原创 Windows下Python安装教程与常见问题
1.安装PythonPython3.x版本与Python2.x版本有很多语法差异,并且不兼容2.x版本,而且现在网上很多资料都是关于Python2.x的,所以建议安装2.x的版本。本文安装的是Python2.7.8,由于自己的win64位的操作系统,刚开始照网上安装64位的教程进行了安装和配置numpy和scipy软件包,比如这个资源链接点击打开链接,http://download.csd
2015-11-21 16:23:10 5665
原创 LeetCode 22:Generate Parentheses
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((()))", "(()())", "(())()", "()(())", "
2015-11-19 15:45:10 531
原创 LeetCode21:Merge Two Sorted Lists
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.//Definition for singly-linked list. struct ListNo
2015-11-19 00:42:10 575
原创 LeetCode20: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 va
2015-11-18 22:21:13 710
原创 LeetCode19:Remove Nth Node From End of List
Given a linked list, remove the nth node from the end of list and return its head.For example,Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, th
2015-11-14 00:24:39 603
原创 MATLAB和C/C++混合编程实现图像处理(一)
MATLAB具有丰富的图像处理函数库,运算速度慢,特别是在多重循环的情况下,不适合直接应用于工程当中。如果能把MATLAB和另一种适合工程的编程语言结合到一起运用到数字图像处理领域,则会更加方便的进行图像处理,MATLAB和C/C++的混合编程,既继承了MATLAB的优点,又拥有了C/C++运算速度快、适合工程应用的特点。一、MATLAB引擎与运行环境配置1.MATLAB引擎MATLA
2015-11-13 22:22:46 4809
原创 vs2010 问题 >LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
VS2010编译过程中出现问题:LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏解决方法如下:项目\属性\配置属性\清单工具\输入和输出\嵌入清单:原来是“是”,改成“否”。说明:这种方法每个工程均需要修改配置。
2015-11-12 17:12:15 611
原创 LeetCode18:4Sum
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note:
2015-11-08 15:44:58 607
原创 LeetCode17:Letter Combinations of a Phone Number
Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given below.Input:Digi
2015-11-08 15:03:16 515
原创 LeetCode16:3Sum Closest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exa
2015-11-06 21:39:15 526
原创 LeetCode15:3Sum
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:Elements in a triplet (a,b,c
2015-11-02 11:03:51 597
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人