- 博客(46)
- 资源 (31)
- 问答 (1)
- 收藏
- 关注
原创 leetcode已完成题目索引
算法研究的重要性2 leetcodeleetcode是面试算法真题,囊括了常用算法思想和经典题目,是算法入门和提升的好材料。我每天都至少训练一个题目,锻炼自己的逻辑思维和写算法的严密性。3 标签和题目常用标签 已完成题目列表 ID Tags Solution 1 Array;HashTable; Two Sum 2 Lin
2017-06-10 21:17:56 13963 1
原创 14. Longest Common Prefix-python
Write a function to find the longest common prefix string amongst an array of strings.思路随机选取一个字符作为最长公共前缀遍历这个前缀的每个字符若所有的字符串都含有这个字符,则最长公共前缀指针前进1Codeclass Solution(object): def longestCommonPrefix
2017-06-30 21:17:23 704
原创 12. Integer to Roman-python
Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.Codeclass Solution(object): def intToRoman(self, num): """ :type num: int
2017-06-29 22:25:09 539
原创 python-list与set相互转换时的一个注意事项
list初始化,里面的元素是set,n1={"","I","II","III","IV","V","VI","VII","VIII","IX"} #1~9n10={"","X","XX","XXX","XL","L","LX","LXX","LXXX","XC"} #10~90n100={"","C","CC","CCC","CD","D","DC","DCC","DCCC","CM"} #10
2017-06-29 22:23:18 18796
原创 python与C, C++,C#一个计算精度的区别
python计算精度问题,如下所示,会自动保留精度 但在C, C++,C#中情况就不尽然,是的结果为01/(Math.Pow(10,3) = 0
2017-06-29 22:04:36 1511
原创 9. Palindrome Number-python
Determine 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 are thinking of converting the intege
2017-06-29 20:07:55 691
原创 7. Reverse Integer-python
Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321Note:The input is assumed to be a 32-bit signed integer. Your function should return 0 when the reversed integ
2017-06-29 20:00:20 1164
转载 图像处理中,outlier和inlier分别指什么?
可以这样理解: 如图所示,给定一些点(红+绿+黑)要求用这些数据点拟合椭圆。 以ransac拟合椭圆为例,可以看出,黄色椭圆为拟合结果, 红色点是由ransac随机选择用来拟合的数据点 黑色点是除红色点外距离椭圆距离小于某一阈值的点,而绿色点是距离椭圆距离大于这一阈值的点 那么,红色+黑色点即为内点,而绿色点为外点: RANSAC为Random Sample Conse
2017-06-29 08:23:05 19404 6
原创 4. Median of Two Sorted Arrays-python
There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).Example 1:nums1 = [1, 3]nums2
2017-06-28 17:25:43 615
原创 3.Longest Substring Without Repeating Characters-python
Given a string, find the length of the longest substring without repeating characters.Examples:Given “abcabcbb”, the answer is “abc”, which the length is 3.Given “bbbbb”, the answer is “b”, with the le
2017-06-28 12:51:10 684
原创 1. Two Sum-python
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 ele
2017-06-27 22:50:24 770
原创 User32-SendInput模拟数字键盘发送到文本框-32位和64位兼容问题
原来的Input结构体为如下,导致只能在32位下运行,using System;using System.Runtime.InteropServices;using System.Drawing;namespace CAXA.MES.ScreenKeyboard { [StructLayout(LayoutKind.Sequential)] internal struct MOU
2017-06-27 15:39:09 2892
原创 入门-误差逆传播算法
定义误差逆传播算法(backpropagation BP算法)是迄今最成功的的神经网络算法。显示任务中使用神经网络时,大多是在使用BP算法进行训练。不仅适用于多层前馈神经网络,还可以用于其他类型的神经网络,训练递归。BP算法如下图的神经网络,有一隐式层,ll个神经元组成的输出层。 重点介绍标准的BP算法,也就是只考虑单个输入神经元节点的误差逆传播,研究的输入例为(xk,yk)(x_k,y_k),假
2017-06-26 22:30:49 9549
原创 入门-神经元模型,感知机与多层网络
M-P模型1943年,McCulloch and Pitts抽象出了“M-P神经元模型”,神经元接受到来自nn个其他神经元传递过来的输入信号,通过带权重的值连接传递,神经元接受到的总输入值与神经元的阈值进行比较,通过激活函数(activation function)处理输出。激活函数理想中的激活函数如下图所示的阶跃函数,它将输入值映射为输出值0 (对应于神经元抑制)或 1(对应于神经元兴奋)。
2017-06-24 08:10:41 1948
原创 48. Rotate Image
原题You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up: Could you do this in-place?代码实现算法思想: public class Solution { //This is in
2017-06-23 10:33:46 1312
原创 图像顺时针步进1个像素点的算法
矩阵步进1的算法public void Rotate(int[,] matrix) { int n = matrix.GetUpperBound(0) + 1; int loop = n >> 1; for (int i = 0; i < loop; i++) {
2017-06-22 22:35:05 1249
原创 Linux-ubuntu常用最基本命令
bash bash是最常见的Shell,全名为 Bourne Again Shell。xiaoming@computername:~$ @之前的,是当前用户的用户名; @后面,“:”前面是计算机名; “:”后面,是当前所在目录; 在“$”后面可以输入命令。echo $PATH 运行这个命令,可以查看环境变量PATH到底是什么。man ifconfig 需要帮助
2017-06-21 21:19:50 496
原创 34. Search for a Range
原题Given an array of integers sorted in ascending order, find the starting and ending position of a given target value.Your algorithm’s runtime complexity must be in the order of O(log n).If the target
2017-06-21 09:28:19 396
原创 32. Longest Valid Parentheses
栈的典型应用。能想到栈,但是能想到Push字符索引,真的不是很容易(这道题一般的想法是存储‘(’ ‘)’这些符号)。原题Given a string containing just the characters ‘(’ and ‘)’, find the length of the longest valid (well-formed) parentheses substring.
2017-06-19 18:28:53 761
原创 .NET-数据拖动
使用场景选中左侧树的某个节点,在右侧表格中显示此节点下的数据list,如果想拖动其中一条数据到另一个树节点下。该如何操作呢。实现代码添加grid的MouseDown事件: private void gridMouseDown(object sender, MouseEventArgs e) { if (e.Button
2017-06-16 13:42:29 551
原创 python-基础结构
特殊运算符** : 指数符号 10**2 = 100声明声明并初始化months = []添加元素通过append接口添加元素months.append("January")months.append("February")添加不同类型的元素到list中,比如float,int,string等类型。months=[]months.append(1)months.append("January
2017-06-16 08:34:36 2002
原创 18. 4Sum
4个数的和等于固定值,利用3个数的和等于固定值的API 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 tar
2017-06-14 14:13:58 491
原创 17. 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.Example1:
2017-06-14 12:54:50 1336
原创 16. 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
2017-06-14 10:29:42 515
原创 15. 3Sum
这道题最难的是所求解不能包含重复的triplets。原题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: The solution
2017-06-14 08:44:41 474
原创 5. Longest Palindromic Substring
背景 “回文”是指正读反读都能读通的句子,它是古今中外都有的一种修辞方式和文字游戏,如“我为人人,人人为我”等。在数学中也有这样一类数字有这样的特征,成为回文数(palindrome number)。设n是一任意自然数。若将n的各位数字反向排列所得自然数n1与n相等,则称n为一回文数。例如,若n=1234321,则称n为一回文数;但若n=1234567,则n不是回文数。 注意:
2017-06-13 08:38:46 2076
原创 3. Longest Substring Without Repeating Characters
原题Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the answer is "b",
2017-06-12 14:27:36 658 1
原创 172. Factorial Trailing Zeroes
原题Given an integer n, return the number of trailing zeroes in n!.Note: Your solution should be in logarithmic time complexity.代码实现计算阶乘n的尾数0的个数 public int TrailingZeroes(int n) {
2017-06-12 13:10:33 564
原创 38. Count and Say
原题The count-and-say sequence is the sequence of integers with the first five terms as following: 1 11 21 1211 111221 1 is read off as “one 1” or 11. 11 is read off as “two 1s” o
2017-06-11 17:21:43 2229
原创 28. Implement strStr()
原题Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.代码实现public int StrStr(string haystack, string needle) {
2017-06-11 16:10:20 561
原创 19. Remove Nth Node From End of List
19. Remove Nth Node From End of List
2017-06-11 15:31:50 741
原创 4. Median of Two Sorted Arrays(归并排序思想)
原题There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).Example 1: nums1 =
2017-06-10 14:00:41 3055
原创 机器学习-基本术语
数据集(data set) 记录的集合,如(色泽=青绿;根蒂=蜷缩;敲声=浊响)示例(instance) 每条记录是关于一个事件或对象的描述,也称为样本。属性(attribute) 反映事件或对象在某方面的表现或性质的事项,例如色泽,根蒂等,又称为特征(feature)。属性上的取值,如青绿,浊响等,称为属性值(attribute value)。样本空间(sample space)
2017-06-08 22:36:28 554
LeetCode-Manager
2017-06-10
LeetCode 完成题目管理工具
2017-06-10
.NET-BackgroundWorker实现异步处理和滚动条报告进度Demo
2017-05-05
归并排序算法程序模拟
2017-03-30
.NET-TreeView控件扩展功能:CheckBoxs父子选中状态同步和自动调整
2017-03-28
快速排序算法实现
2017-03-16
.NET: Xml.Serialization常用对象导图
2017-03-10
如何由浅复制到深度复制
2017-03-07
C#中的ArrayList导图
2017-03-07
用C#描述数据结构2:Array
2017-03-06
统计代码执行时间对象
2017-03-06
根据业务倒推观察者模式
2017-03-05
mvc 新建本地mdf 出错
2017-03-14
TA创建的收藏夹 TA关注的收藏夹
TA关注的人