`
junfeng_feng
  • 浏览: 18344 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
再总结反省一下,12年远没有11年那样看了很多书(只是看了,并不代表成长很多)。 总结一下11年记得最清的是学习了Python,比之前更熟悉C++,初步开始使用Linux,接触互联网广告。 先罗列一下12年看过的书吧: 1. 《Effective STL》 这个不用说了,想使用C++ STL都应该读一下,虽然我现在书中内容基本都忘记了,而且国内很难买到正版的书(我的就是复印的)。 2. 《深度探索C++对象模型》 通过本书可以了解编译器做了哪些事情,以及对象内存空间模型。了解C++倒底哪些是导致性能影响的,还有就是为什么要用C++。 3. 《重构》 一本好书,可是我自己的真正 ...
先解释一下,为什么从09年开始就一直使用ubuntu10.10,大三的时候开始接触虚拟机VmWare使用Ubuntu。那时不懂什么是LTS,在这个虚拟机上安装了vim,g++,jdk,mysql,xlamp,python2.7,curl,go,adobe,ibus,chrome,firefox,qq,msn,openfetion,open office,msn等所以就不方便升级到12.04。 P.S.我不喜欢12.04的新风格。 进入正题 搜索“ubuntu 升级到gcc4.7” sudo add-apt-repository ppa:ubuntu-toolchain-r/tes ...
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) ...
#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/gkqo ...
如 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) { ...
二分查找查找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) { ...
class Solution { public: vector<int> plusOne(vector<int> &digits) { // Start typing your C/C++ solution below // DO NOT write int main() function vector<int> result; int carray_bit = 0; digits[digits.size()-1] += 1; for(int i=d ...
//需要注意细节 class Solution { public: string longestCommonPrefix(vector<string> &strs) { // Start typing your C/C++ solution below // DO NOT write int main() function //sort(strs.begin(),strs.end()); string result(""); if (strs.size()==0) { ...
使用统计学的方法:O(n) 分治的方法,比较复杂 class Solution { public: int maxSubArray(int A[], int n) { // Start typing your C/C++ solution below // DO NOT write int main() function int maxendinghere=A[0]; int max = maxendinghere; for(int i=1;i<n;i++) { if (m ...
http://www.leetcode.com/onlinejudge class Solution { public: vector<string> anagrams(vector<string> &strs) { // Start typing your C/C++ solution below // DO NOT write int main() function multimap<string,string> map; for(int i=0;i<strs.size( ...
直接使用加法 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode *addTwoNumbers(ListNode *l1, ListNode *l2) { // Start typing your C/C++ solution below ...
LeetCode interview Questions:Add binay 1.int之类的数可以使用small 2.直接在字符串使用二进制的加法 http://www.leetcode.com/onlinejudge 需要 class Solution { public: int string_to_int(string str) { int result = 0; int level = 1; for(int i = str.length() - 1; i >=0 ; i--) { if (str ...
#include<iostream> using namespace std; int main() { uint32_t size; cin >> size; int arr[size]; printf("size address::%x\n", &size); printf("array address::%x\n", &arr[0]); return 0; } 这段代码,可以编译通过。可以在栈上开辟一个运行时才知道大小的数组。(参考:http://ericwan ...
from math import log def I(*args): total = sum(args) + 0.0 result = 0.0 for i in args: if i == 0: result += 0 else: result += i / total * log( i / total, 2) return -result #num表示分类的个数 def E(num, *args): if len(args) % num != 0: ...
#!C:/Python27/python.exe #coding=gbk import sys __author__ = "junfeng_feng" """Python实现Apri算法 input:数据文件名 最小支持度 ouput:所有频繁项集 支持度 Usage:python Apri.py filename min_surpport Exampe: python Apri.py data.txt 2 3点说明 1、使用Python不到70行的代码,简洁完整的实现Apri算法 2、使用内存存放数据(Python会做相应大文件的优化) ...
Global site tag (gtag.js) - Google Analytics