码迷,mamicode.com
首页 >  
搜索关键字:clustering algorithm    ( 12082个结果)
Algorithm(1) - Karatsuba multiplication
这个系列主要是记一下目前效率较高或者比较出名的一些算法.Karatsuba multiplication:x=5678 then: a=56 b=67y=1234 c=12 d=34setps: 1: a*c = 672 ①2: b*d=2652 ②3: (a+b)(c+d)=6164 ③4: ③....
分类:其他好文   时间:2014-06-15 22:00:22    阅读次数:335
【Algorithm】选择排序
一. 算法描述 选择排序:比如在一个长度为N的无序数组中,在第一趟遍历N个数据,找出其中最小的数值与第一个元素交换,第二趟遍历剩下的N-1个数据,找出其中最小的数值与第二个元素交换......第N-1趟遍历剩下的2个数据,找出其中最小的数值与第N-1个元素交换,至此选择排序完成。 举个例子:5 .....
分类:其他好文   时间:2014-06-15 21:21:56    阅读次数:169
MD5和Base64
一. 简述 MD5: 全称为message digest algorithm 5(信息摘要算法), 可以进行加密, 但是不能解密, 属于单向加密, 通常用于文件校验 Base64: 把任意序列的8为字节描述为一种不易为人识别的形式, 通常用于邮件、http加密. 登陆的用户名和密码字段通过它加密, 可以进行加密和解密. 二. 代码 1. MD5:...
分类:其他好文   时间:2014-06-15 15:18:25    阅读次数:263
【Leetcode】Search a 2D Matrix
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted from left to right.The first integer of each...
分类:其他好文   时间:2014-06-15 14:12:44    阅读次数:238
[LeetCode] Combinations [38]
题目 Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For example, If n = 4 and k = 2, a solution is: [ [2,4], [3,4], [2,3], [1,2], [1,3],...
分类:其他好文   时间:2014-06-15 14:10:54    阅读次数:239
[LeetCode] Word Search [37]
给一个二维字符数组,给一个字符串,问该二维数组是否包含该字符串。比如一个二维数组[ ABCE SFCS ADEE ]和字符串"ABCCED",这个就包含。解决这个问题,主要的关键是怎么解决在二维数组中查找方向,如何来标识哪些是走过的。 代码如下...
分类:其他好文   时间:2014-06-15 10:02:15    阅读次数:221
【Algorithm】插入排序
一. 算法描述 插入排序具体算法描述如下:从第一个元素开始,该元素可以认为已经被排序取出下一个元素,在已经排序的元素序列中从后向前扫描如果该元素(已排序)大于新元素,将该元素移到下一位置重复步骤3,直到找到已排序的元素小于或者等于新元素的位置将新元素插入到该位置后重复步骤2~5 举个例子:5 7.....
分类:其他好文   时间:2014-06-14 19:06:15    阅读次数:236
[LeetCode] Search in Rotated Sorted Array II [36]
题目 Follow up for "Search in Rotated Sorted Array": What if duplicates are allowed? Would this affect the run-time complexity? How and why? Write a function to determine if a given target is in the array. 原题链接(点我) 解题思路 这题和Search in Rotated Sorted Array问题类似,...
分类:其他好文   时间:2014-06-14 12:44:18    阅读次数:266
PS 滤镜——染色玻璃
%%%% 完成PS 中的染色玻璃滤镜特效 clc; clear all; close all; addpath('E:\PhotoShop Algortihm\Image Processing\PS Algorithm'); Image=imread('4.jpg'); Image=double(Image); Gray_Image=rgb2gray(Image/...
分类:其他好文   时间:2014-06-14 10:39:21    阅读次数:240
C++设计模式实现--策略(Strategy)模式
一. 举例说明 以前做了一个程序,程序的功能是评价几种加密算法时间,程序的使用操作不怎么变,变的是选用各种算法。 结构如下: Algorithm:抽象类,提供算法的公共接口。 RSA_Algorithm:具体的RSA算法。 DES_Algorithm:具体的DES算法。 BASE64_Algorithm:具体的Base64算法。 在使用过程...
分类:编程语言   时间:2014-06-14 10:09:35    阅读次数:379
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!