Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.
get(key) - Get the value (will always be positive) of the key if...
分类:
系统相关 时间:
2015-01-05 14:54:59
阅读次数:
219
写在最前,摘自 K&R
The only legal operations on a structure are copying it or assigning to it as a unit, taking its address with & (读作
ampersand), and accessing its members,
翻译成中文是这样的,对于一个结构体而言,唯一合...
分类:
移动开发 时间:
2015-01-04 21:25:24
阅读次数:
907
微软近期Open的职位:Job posting title: Senior Development EngineerLocation: China, BeijingDivision: Operations System Group Engineering   Group OverviewOS...
分类:
移动开发 时间:
2015-01-02 12:09:40
阅读次数:
245
Two Sum III - Data structure design
Total Accepted: 311
Total Submissions: 1345
Design and implement a TwoSum class. It should support the following operations:
add and find.
add - Add the n...
分类:
其他好文 时间:
2014-12-31 08:45:14
阅读次数:
243
转载自http://www.stroustrup.com/C++11FAQ.html仅供个人参考, 收藏用control of defaults: move and copyBy default, a class has 5 operations:copy assignmentcopy constr...
分类:
编程语言 时间:
2014-12-30 17:02:01
阅读次数:
186
Description You haveNintegers,A1,A2, ... ,AN. You need to deal with two kinds of operations. One type of operation is to add some given number to eac....
分类:
其他好文 时间:
2014-12-28 23:31:26
阅读次数:
235
这道题比较简单。需要注意的一些地方:1、impossible: 所有的标记量都是false2、not sure:同时存在2种情况或者同时存在三种情况.Problem II Can Guess the Data Structure!There is a bag-like data structure, supporting two operations:1 xThrow an element x i...
分类:
编程语言 时间:
2014-12-28 20:51:37
阅读次数:
217
Ext2索引节点的操作一些VFS索引节点的操作在Ext2中都有具体的体现,这取决于索引节点所指的文件类型。Ext2的普通文件和目录文件的索引节点操作的方法地址分别存放在:ext2_file_inode_operations和ext2_dir_inode_operationsstructinode_operationsext2_file_inode_operations=..
分类:
其他好文 时间:
2014-12-26 14:56:04
阅读次数:
208
linux 设备驱动之IOCTRL
1,where come from?
ioctrl(或者说unlocked_ioctl/compat_ioctl)是file_operations结构体的函数指针
struct file_operations {
...
long (*unlocked_ioctl) (struct file *, unsigned i...
分类:
系统相关 时间:
2014-12-25 20:34:47
阅读次数:
452
传送门:cf 498C
给定一个长度为n的数组,已经m组下标对应关系(下标之和为奇数),现在可以对m组对应关系中的数同除一个大于1的整数,问最多能进行多少次这样的操作
要操作次数最大,每次处理的时候应该除质数。
下标之和为奇数,不难发现它构成了一张二分图。
枚举sqrt(10^9)的质数,找出n个数中各有多少个这样的质数k,然后建立对应的图,跑网络流最大流即可。
/*******...
分类:
其他好文 时间:
2014-12-25 10:04:51
阅读次数:
200