11 2012 档案
摘要:Deep Learning 介绍Deep Learning is a new area of Machine Learning research, which has been introduced with the objective of moving Machine Learning closer to one of its original goals: Artificial Intelligence.Deep Learning 动机Deep Learning --主要用于NLP(自然语言处理),可用于情感分析 --算法库(Python) --Deep Belief Networ...
阅读全文
摘要:#include<iostream>#include<cstdio>#include<cstdlib>using namespace std;class Node {public: Node* next; Node* rand; int value;};Node* copy_list_with_rand_ptr(Node* list) { if(list == NULL) { return NULL; } /* * 参考:http://hi.baidu.com/gkqofoydngbjqtq/item/6345d6104b7a8d06e...
阅读全文
摘要:如 1,2,3,...10出现11个数字,1,2,3..11出现了13个数字。现在知道出现d个数字,求n,如果d非法,输出impossible。算法的思想是:计算n = 9, 99, 999...这些长度为1,2,3...的各个数的出现的数字个数,反推d。int calc_from_number_of_digits(int d)
{ if(d < 9) return d; int n = 0; int last_n = 0; int len = 1; while(d > n) { last_n = n; ...
阅读全文
摘要:二分查找查找key最左和最右的位置利用这个特点,可以在O(log n)时间 在排序的数组中,统计一个数出现的次数。如[1,2,2,3],2出现了两次//most_left_or_right: true 表示最左, false表示最右
int binary_search_most_left_or_right(int* array, int size, int key, bool most_left_or_right = true)
{ int low = 0; int high = size - 1; while(low <= high) { int mi...
阅读全文
浙公网安备 33010602011771号