在网上总能发现一些感兴趣的东西,从前是直接转载过来,现在发现太多了,还是汇总url吧。积累,慢慢开始......
1. 斯坦福Richard Socher在EMNLP2014发表新作:GloVe: Global Vectors for Word Representation 粗看是融合LSA等算法的想法,利用global word co-occurrence信息提升word vector...
分类:
其他好文 时间:
2014-08-07 18:55:00
阅读次数:
216
该题可以用DFS解决,在DFS时记录path,当到达leaf时将path所表示的数加到sum上。 1 class Solution { 2 public: 3 int sumNumbers(TreeNode *root) { 4 vector path; 5 ...
分类:
其他好文 时间:
2014-08-07 18:50:40
阅读次数:
197
Easy Problem from Rujia Liu?
Time Limit:1000MS Memory Limit:0KB 64bit IO Format:%lld
& %llu
Description
Easy Problem from Rujia Liu?
Though Rujia Liu usually sets...
分类:
其他好文 时间:
2014-08-07 15:54:00
阅读次数:
259
如果vector保存内置类型的元素,那么标准库将用0值创建元素的初始化式。 如果vector保存的是含有默认构造函数的类类型,标准库将用该类型的默认构造函数初始化元素。 如果vector保存的是有自定义构造函数没有默认...
分类:
其他好文 时间:
2014-08-07 13:33:50
阅读次数:
175
Intel® Advanced Vector Extensions (Intel® AVX) is a set of instructions for doing Single Instruction Multiple Data (SIMD) operations on Intel® architecture CPUs. These instructions extend previous SIM...
分类:
其他好文 时间:
2014-08-07 00:51:07
阅读次数:
995
一、要删除容器中有特定值的所有对象
1、如果容器是vector、string或deque,则使用erase-remove习惯用法。例如:
vector c;
c.erase(remove(c.begin(),c.end(),1963),c.end());//删除值是1963的元素
下面讲一下算法remove:
template
ForwardIterat...
分类:
其他好文 时间:
2014-08-07 00:48:37
阅读次数:
371
本文主要分析gcc4.8版本的stl list的源码实现,与vector的线性空间结构不同,list的节点是任意分散的,节点之间通过指针连接,好处是在任何位置插入删除元素都只需要常数时间,缺点是不能随机访问,查询复杂度是O(n),n为list中的元素个数。所以list非常适合应用与数据插入删除频繁的...
分类:
其他好文 时间:
2014-08-07 00:27:17
阅读次数:
358
1. Thread with lambda function
基于前一章中的Lambda程序,我们进行了扩展,当前创建5个线程。
#include
#include
#include
#include
int main()
{
std::vector threadVec;
for(int i=0; i<5; ++i){
threadVec.push_back(std::thr...
分类:
编程语言 时间:
2014-08-06 23:09:02
阅读次数:
248
问题:全排列class Solution {public: void dfs(vector &num,vector &vec2,vector >&vec1,int step,int vis[]) { if(step==num.size()) { ...
分类:
其他好文 时间:
2014-08-06 22:25:02
阅读次数:
193
问题:从左上角到右下角的最小路径和class Solution {public: int num[300][300]; int dfs(int x,int y,vector >&grid) { if(x==grid.size()-1 && y==grid[0].siz...
分类:
其他好文 时间:
2014-08-06 22:22:52
阅读次数:
231