关闭
当前搜索:

14. Longest Common Prefix-python

Write a function to find the longest common prefix string amongst an array of strings.思路 随机选取一个字符作为最长公共前缀 遍历这个前缀的每个字符 若所有的字符串都含有这个字符,则最长公共前缀指针前进1 Codeclass Solution(object): def longestCommonPrefix...
阅读(210) 评论(0)

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...
阅读(126) 评论(0)

python-list与set相互转换时的一个注意事项

list初始化,里面的元素是set,n1={"","I","II","III","IV","V","VI","VII","VIII","IX"} #1~9 n10={"","X","XX","XXX","XL","L","LX","LXX","LXXX","XC"} #10~90 n100={"","C","CC","CCC","CD","D","DC","DCC","DCCC","CM"} #10...
阅读(607) 评论(0)

python与C, C++,C#一个计算精度的区别

python计算精度问题,如下所示,会自动保留精度 但在C, C++,C#中情况就不尽然,是的结果为01/(Math.Pow(10,3) = 0...
阅读(449) 评论(0)

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...
阅读(390) 评论(0)

7. Reverse Integer-python

Reverse digits of an integer.Example1: x = 123, return 321 Example2: x = -123, return -321Note: The input is assumed to be a 32-bit signed integer. Your function should return 0 when the reversed integ...
阅读(403) 评论(0)

图像处理中,outlier和inlier分别指什么?

可以这样理解: 如图所示,给定一些点(红+绿+黑)要求用这些数据点拟合椭圆。 以ransac拟合椭圆为例,可以看出,黄色椭圆为拟合结果, 红色点是由ransac随机选择用来拟合的数据点 黑色点是除红色点外距离椭圆距离小于某一阈值的点,而绿色点是距离椭圆距离大于这一阈值的点 那么,红色+黑色点即为内点,而绿色点为外点: RANSAC为Random Sample Consensus的...
阅读(647) 评论(0)

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...
阅读(327) 评论(0)

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...
阅读(287) 评论(0)

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...
阅读(419) 评论(0)

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...
阅读(248) 评论(0)

入门-误差逆传播算法

定义误差逆传播算法(backpropagation BP算法)是迄今最成功的的神经网络算法。显示任务中使用神经网络时,大多是在使用BP算法进行训练。不仅适用于多层前馈神经网络,还可以用于其他类型的神经网络,训练递归。BP算法如下图的神经网络,有一隐式层,ll个神经元组成的输出层。 重点介绍标准的BP算法,也就是只考虑单个输入神经元节点的误差逆传播,研究的输入例为(xk,yk)(x_k,y_k),假...
阅读(716) 评论(0)

入门-神经元模型,感知机与多层网络

M-P模型1943年,McCulloch and Pitts抽象出了“M-P神经元模型”,神经元接受到来自nn个其他神经元传递过来的输入信号,通过带权重的值连接传递,神经元接受到的总输入值与神经元的阈值进行比较,通过激活函数(activation function)处理输出。激活函数理想中的激活函数如下图所示的阶跃函数,它将输入值映射为输出值0 (对应于神经元抑制)或 1(对应于神经元兴奋)。...
阅读(305) 评论(0)

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...
阅读(1065) 评论(0)

图像顺时针步进1个像素点的算法

矩阵步进1的算法public void Rotate(int[,] matrix) { int n = matrix.GetUpperBound(0) + 1; int loop = n >> 1; for (int i = 0; i < loop; i++) {...
阅读(804) 评论(0)

Linux-ubuntu常用最基本命令

bash bash是最常见的Shell,全名为 Bourne Again Shell。 xiaoming@computername:~$ @之前的,是当前用户的用户名; @后面,“:”前面是计算机名; “:”后面,是当前所在目录; 在“$”后面可以输入命令。 echo $PATH 运行这个命令,可以查看环境变量PATH到底是什么。 man ifconfig 需要帮助...
阅读(151) 评论(0)

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...
阅读(243) 评论(0)

32. Longest Valid Parentheses

栈的典型应用。能想到栈,但是能想到Push字符索引,真的不是很容易(这道题一般的想法是存储‘(’ ‘)’这些符号)。 原题 Given a string containing just the characters ‘(’ and ‘)’, find the length of the longest valid (well-formed) parentheses substring....
阅读(507) 评论(0)

.NET-数据拖动

使用场景选中左侧树的某个节点,在右侧表格中显示此节点下的数据list,如果想拖动其中一条数据到另一个树节点下。该如何操作呢。实现代码添加grid的MouseDown事件: private void gridMouseDown(object sender, MouseEventArgs e) { if (e.Button...
阅读(182) 评论(0)

python-基础结构

特殊运算符** : 指数符号 10**2 = 100声明声明并初始化months = []添加元素通过append接口添加元素months.append("January") months.append("February")添加不同类型的元素到list中,比如float,int,string等类型。months=[] months.append(1) months.append("January...
阅读(1725) 评论(0)
46条 共3页1 2 3 下一页 尾页
    算法channel

    交流思想,注重分析,实例阐述,通俗易懂,包含但不限于:经典算法,机器学习,深度学习,LeetCode 题解,Kaggle 实战。期待您的到来!

    算法与人工智能交流群:646901659

    个人资料
    • 访问:297312次
    • 积分:7372
    • 等级:
    • 排名:第3198名
    • 原创:351篇
    • 转载:0篇
    • 译文:0篇
    • 评论:55条
    博客专栏