Word2Vec代码阅读
From tensorflow/tutorials
主函数,执行入口
图表示学习,将节点从高维表示空间映射到低维向量空间,得到表示向量,作用于后续的分类、预测等任务。
然而在真实场景中,图是动态变化的(或者说流式存在的),因此研究动态图的表示学习是很有必要的,也是近些年的一个热门研究问题。
递归 / 回溯算法
二分查找的问题,往往关键是定义需要查找的结构是什么,且结构必须是排序的,然后查找过程是简单的,即通过三个指针left
、right
和middle
迭代直至收敛。
There is a box protected by a password. The password is a sequence of n digits where each digit can be one of the first k digits 0, 1, …, k-1.
Given an array of non-negative integers, you are initially positioned at the first index of the array.
Given a string containing just the characters ‘(‘ and ‘)’, find the length of the longest valid (well-formed) parentheses substring.
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.
生成滑动窗口的最大值/最小值数组,可以直接作为题目,也可以间接作为预处理方法。 时间复杂度为$O(n)$。
和子数组、子矩阵以及给定目标值相关的题型。
set
结构,对应insert
和lower_bound
函数,时间复杂度为O(m^2nlogn)并查集,主要是两个函数unoin
和find
,并且可以分别在两个函数中加入优化:重量权衡分配和路径压缩。