
算法
mlnotes
这个作者很懒,什么都没留下…
展开
-
二十世纪最伟大的十大算法
一、1946 蒙特卡洛方法[1946: John von Neumann, Stan Ulam, and Nick Metropolis, all at the Los Alamos Scientific Laboratory, cook up the Metropolis algorithm, also known as the Monte Carlo method.]1946年,美国拉斯阿莫斯原创 2013-08-01 00:49:08 · 574 阅读 · 0 评论 -
数据挖掘十大算法(1)
http://blog.renren.com/share/252962312/2591837552/原创 2013-08-01 00:49:10 · 580 阅读 · 0 评论 -
排序算法
void quicksort(int arr[], int length){ if(!arr || length return; else if(length == 2) //当长度为2时,一定要进行判断返回,否则递归无法结束 { if (arr[0] > arr[1])原创 2013-08-01 00:49:30 · 533 阅读 · 0 评论 -
背包问题
Let V[i , j ] be the value obtained by filling a knappack of size j withitems taken from the first i items {u1, . . . , ui} in an optimal way.The recurrence relation 0原创 2013-08-01 00:49:34 · 618 阅读 · 0 评论 -
copy-on-write
其实也就是在要写时,才复制一份,并写在这个新的备份上,这样原来的内容就不需要修改可以参考 http://www.programlife.net/copy-on-write.html原创 2013-08-01 00:53:48 · 635 阅读 · 0 评论 -
Longest Palindromic Substring leetcode
Manacher's Algorithm#include #include using namespace std; string longestPalindrome(string s){ // Start typing your C/C++ solution below // DO NOT write int main() function int size = s.siz原创 2013-08-01 00:56:40 · 936 阅读 · 0 评论 -
Regular Expression Matching LeetCode
这题主要采用递归的方式解决,这样代码比较容易理解bool isMatch(const char *s, const char *p){ if(p[0] == '*') return false; else if(p[0] == 0) return s[0] == 0; else if(p[0] == '.') { if(p[1] =原创 2013-08-01 00:56:42 · 1180 阅读 · 0 评论