字符串插入字符
s.push_back(char c)
字符串逆序
reverse(s.begin(),s.end() )
字符串分割
substr(s , pos, len)
从pos位置连续len个字节
字符串转int stoi
确定字符串在函数中不会更改的话,用&的方式传参数会更快,养成好习惯
如bool cmp(string &s1,string &s2)
加快cin cout速度:
ios::sync_with_stdio(false)
priority_queue<int, vector, greater> q;//模拟内存的排序,从小到大排列
和队列基本操作相同:
top 访问队头元素
empty 队列是否为空
size 返回队列内元素个数
push 插入元素到队尾 (并排序)
pop 弹出队头元素
swap 交换内容
map基本使用
map<a ,b > m
m.insert(pair<a ,b >( ) )
m.size()等
使用迭代器遍历map:
for(iter = _map.begin(); iter != _map.end(); iter++) {
cout << iter->first << " : " << iter->second << endl;
}
完全二叉树可以用一维数组存储,索引从1到n,此时结点i的左子树索引为2i,右子树为2i+1
——————————————————————
单词
non-leaf nodes 非叶子结点
every seniority level 每一层
vertices 顶点
edges 边
indices 索引
labeling 标记
implementation 实现
Topological Order 拓扑排序
clique 团
radix 根,基数
decimal 小数的,十进位的
symmetric 对称的
randomize 使…随机化
collaborate 合作
gamblers 赌徒
inadequate 不充分的
shuffles 洗牌
casino 赌场
simulate 假装,模拟,模仿
a deck of playing cards 一副牌
Joker 鬼牌
红桃(Heart)、黑桃(Spade)、方片(Diamond)、梅花(Club)
trophy 奖牌,奖杯
Lottery 彩票
distinct 清晰的,明显的,不同的
top-down 自顶向下
decimal 小数
general 通用的,普遍的,普通的
decimal system 十进制 == decimal number
any numeral system 任何进制
notorious 臭名昭著的,声名狼藉的,众人皆知的
suffix 后缀
stuck 动不了的,被卡住的
Deduplication 链表去重
absolute value 绝对值
separate 分开的,独有的,另外的
adjacent 毗连的,邻近的
be supposed to 应该,被期望
exactly 确切地
course 课程
Course List for Student 学生选课情况
alphabetical 按字母顺序
fundamental 基本的,重要的
even 偶数
odd 奇怪的,奇数
hence 因此
recursively 递归
register 注册
specify 具体说明
potential 潜在的
cluster 集群
property 房产,财产
estate 房产
unit price 单价
two-digit number 两位数
For the sake of simplicity 为了简单起见
for every seniority level 对于每一个高层,对于每一层
bonus 奖金,红利,好处
coupon 优惠券
Forbes 福布斯(美国著名财经杂志)
be supposed to 应该,被期望
tie 平局
ascend 上升 increasing 上升
descend 下降 decreasing 下降
Stripe 条纹,链
distinguish 区分,区别
key words 关键词
Note: Simple chopping is assumed without rounding. 不用四舍五入
It is assumed that 我们假定…
followers 追随者,支持者
Hence 因此
forward 转发
indirect 间接的,拐弯抹角的,迂回的
with positive increments only 只是正向增加
Quadratic probing 平方探查法
respectively 各自地
disjoint 不相交的,脱节,解体
partition 分割,分隔
denote 代表,指示,表示
permutation 一组排列
volume 容积,量,体积
threshold 起征点,下限,开端
M by N matrix m行n列矩阵
quota 限额
for the sake of 为了
scattered cities 分散的城市
recommendation 推荐,建议
candidate 候选的
residential 住宅区
client 委托人,客户,当事人
one-way is 1 if the street is one-way from V1 to V2, or 0 if not
如果该道路是从V1到V2的单行线,则one-way为1,否则为0
fewest intersections 最少结点的
intersection 交点,交集