自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

相信相信的力量

公众号:Python与算法社区

  • 博客(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

原创 12. Integer to Roman

Integer to Roman

2017-06-13 17:26:12 621

原创 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

原创 165. Compare Version Numbers

Compare Version Numbers

2017-06-11 22:16:34 638

原创 70. Climbing Stairs

70. Climbing Stairs

2017-06-11 21:41:32 770

原创 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

原创 2. Add Two Numbers

2. Add Two Numbers

2017-06-09 15:00:18 710

原创 机器学习-基本术语

数据集(data set) 记录的集合,如(色泽=青绿;根蒂=蜷缩;敲声=浊响)示例(instance) 每条记录是关于一个事件或对象的描述,也称为样本。属性(attribute) 反映事件或对象在某方面的表现或性质的事项,例如色泽,根蒂等,又称为特征(feature)。属性上的取值,如青绿,浊响等,称为属性值(attribute value)。样本空间(sample space)

2017-06-08 22:36:28 554

原创 机器学习利用Anaconda搭建Python科学计算环境

机器学习利用Anaconda搭建Python科学计算环境

2017-06-08 21:31:46 2236

原创 455. Assign Cookies

455. Assign Cookies

2017-06-08 18:21:19 540

原创 56. Merge Intervals

56. Merge Intervals

2017-06-08 12:51:25 602

Demo: c/c++动态库(DLL)调用,c#等其他语言调用c/c++的DLL

c++动态库调用另一个动态库 c++动态库调用c动态库 c#等其他语言调用c/c++动态库

2017-08-09

斯坦福大学CS246 book-Mining of Massive Datasets

斯坦福大学 Mining of Massive Datasets

2017-07-06

LeetCode-Manager

自己基于.NET平台,EF框架,制作的本地SQL Server小工具,专门管理LeetCode标签和题目,能输出用于CSDN博客和Github表格模板的功能。

2017-06-10

LeetCode 完成题目管理工具

自己基于.NET平台制作的本地SQL Server小工具,专门管理LeetCode标签和题目,能输出用于CSDN博客和Github表格模板的功能。

2017-06-10

.NET-BackgroundWorker实现异步处理和滚动条报告进度Demo

.NET-BackgroundWorker实现异步处理和滚动条报告进度Demo http://blog.csdn.net/daigualu/article/details/71211336

2017-05-05

leetcode-tag-Tree

leetcode-tag-Tree

2017-04-29

leetcode-tag-Stack

leetcode-tag-Stack

2017-04-29

leetcode-tag-dynamic programming

leetcode-tag-dynamic programming

2017-04-29

leetcode-tag-array

leetcode-tag-array

2017-04-29

归并排序算法程序模拟

归并排序过程的前半部分,过程示意图见下,从图中可见,步骤1,2,3,4一直分割区间,等到步骤5时,左右区间长度都为1,此时发生一次归并,结果再与另一个区间长度为1的归并,即步骤6;步骤7分割,步骤8归并,步骤9归并后前半部分合并结束; 后半部分过程与前半部分归并一致,不再详述。

2017-03-30

.NET-TreeView控件扩展功能:CheckBoxs父子选中状态同步和自动调整

.NET System.Windows.Forms命名控件中TreeView组件,有一个CheckBoxs属性,控制着这个控件每个节点前是否显示勾选框,如果设置为true,所有节点的勾选框选中,反之都不选中;如果选中父节点,子节点不会自动选中。根据需求,自动扩展了这个控件,使具备父子选中状态同步。如果鼠标离开这个控件,通过鼠标单击,隐藏复选框,否则进入某个节点,单击,显示复选框。

2017-03-28

模拟KMP失配函数next过程分析

模拟KMP失配函数next过程分析

2017-03-23

实例模拟KMP算法的next失配函数

实例模拟KMP算法的next失配函数

2017-03-21

快速排序算法实现

选取一个关键码key,一趟排序将要排序的数据分割成独立的两部分,key前的元素都小于key, 靠后的都大于key, 然后再按此方法对这两部分数据分别进行快速排序,整个排序过程可以递归进行,以此达到整个数据变成有序序列。

2017-03-16

C# Sort 按年龄排序

2万多名员工按年龄排序算法, 算法思想是归并排序,同时结合年龄取值的实际情况。

2017-03-15

LinkedList 所有公有方法和属性 导图

.NET框架中的LinkList,实现的是双向链表,总结下它的实现源码。 LinkedList提供的公有属性和方法的导图

2017-03-13

C# System.Collections所有对象的类图,结构图

System.Collections导图,不含泛型(泛型与非泛型基本一致)

2017-03-13

.NET: Xml.Serialization常用对象导图

.NET框架中,System.Xml.Serialization 命名空间包含着用来将对象序列化为XML的文本或流的对象。

2017-03-10

模拟实验-C#版基于二分查找的稳定“插入排序”算法

程序模拟实验所用到的所有源码,包括冒泡排序,插入排序,代码运行时长统计等。

2017-03-10

冒泡排序修正版本

冒泡排序C#描述和模拟分析

2017-03-09

用C#描述数据结构4:模拟冒泡排序过程,比较次数分析

先生成一堆乱序的集合。在.NET中通过Random,生成随机数,模拟了排序的过程,分析了两两比较大于1次的比较!

2017-03-08

C#语言及全应用思维导图

C#语言及全应用思维导图

2017-03-08

如何由浅复制到深度复制

我想实现了深度复制呢,也就是我新复制出来的对象不是仅仅复制引用, 而是复制对象!比如说,你需要在一个模板的基础上修改出5个版本的建立,每个版本投递到不同的企业上,版本1投给公司A,版本2投给公司B,。。。假如说这5个版本的不同仅仅是“我期望加入某某公司”,某某换成5个公司对应的名称。

2017-03-07

C#中的ArrayList导图

ArrayList。   首先,它不是静态的,编译时每一维度的元素个数不用指定,系统默认元素个数为16,当元素增多并即将大于16时,它会增倍扩容到32,依次规律增长,变小时,相反处理。   其次,元素类型是弱类型,object。在运行时,根据实际被赋予的类型,确定每个元素的类型,也就是说,这个集合中的元素可以是各种不同的元素,鱼龙混杂式的。

2017-03-07

Array:一维和二维接口语义区分

Array: 一维和二维初始化,常用易混淆的语义接口!

2017-03-06

用C#描述数据结构2:Array

Array是.NET提供的最基础的数据集合,通过索引直接访问集合元素。提供一维或多维数据存储,并支持诸如,查询,搜索,排序,复制等操作。 提供的主要接口,根据语义划分,主要包括:

2017-03-06

统计代码执行时间对象

自定义一个统计代码执行时间的类*CalcTiming*,考虑了: - 在统计执行过程中,不允许有垃圾回收。即在统计代码执行时间之前,就让GC完成垃圾回收。 - 确保统计的是当前进程中代码的执行时间。

2017-03-06

数据结构用C#语言描述

  数据结构对专业程序员的开发起到至关重要的作用。正在开始一个专栏,准备把导图中涉及到的数据结构用C#语言写一遍。

2017-03-06

基于C#.NET的visual studio编写的贷款分析器

基于C#.NET的visual studio编写的贷款分析器

2017-03-05

根据业务倒推观察者模式

订阅-分发模式,又叫观察者模式,那么这种模式它的实现机理是什么?它该如何在产品开发中实际应用呢? 我们学一种模式,最好不要死板的去学它,可以根据业务的需求将伪代码逐渐转化为真正的代码。自己画画图,编编码,体会这种机制,这样完全实践一遍后,才能真正体会这种模式的精髓所在,然后将其用于以后的产品开发中。

2017-03-05

Windows程序运行原理

Windows程序运行原理

2014-10-26

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

TA关注的人

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