重新写了下,代码看着清爽多了 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * ListNode(int x...
分类:
其他好文 时间:
2014-09-04 20:54:00
阅读次数:
162
当初学习C语言时并没有特别注意union的用法,也不知道与struc t相比有何不同。经过网上的一番搜索,现在总算是恍然大悟,所以就小结一下。如有错误之处,敬请指正。(struct和union的结构定义形式没有多大差别,只要不是初学者,相信大家不会在这方面存在什么问题。)struct简单来说就是一些...
分类:
其他好文 时间:
2014-09-04 20:47:20
阅读次数:
207
+ (NSString*)deviceString
{
// 需要#import "sys/utsname.h"
struct utsname systemInfo;
uname(&systemInfo);
NSString *deviceString = [NSString stringWithCString:systemInfo.m...
分类:
其他好文 时间:
2014-09-04 19:08:40
阅读次数:
219
#include #include const int maxn = 1000;int Num_of_Player;int m_val;typedef struct{ int num, password; struct LNode *next;}*players, lnode;void ...
分类:
其他好文 时间:
2014-09-04 18:23:49
阅读次数:
242
腾讯三面的时候,叫我写了个哈希表,当时紧张没写好···结果跪了··· 回来后粪发涂墙,赶紧写了一个! 什么都不说了···先让我到厕所里面哭一会··· %>_ 2 #include 3 #include 4 #include 5 6 struct node { 7 ...
分类:
编程语言 时间:
2014-09-04 16:23:59
阅读次数:
240
对于dup和fork函数来说,前者是复制一个文件描述符,后者是复制进程,同时相关的文件信息也会被复制。
一、对于Dup
之前已经知道,对于一个进程来说,有一个files_struct来管理所有的相关文件,最终的反应形式其实就是一个文件数组而已:
所谓文件描述符就是数组下标...
分类:
系统相关 时间:
2014-09-04 15:00:29
阅读次数:
280
#include
#include
#include
#include
#include
#include
#include
using namespace std;
const int maxn = 1005;
#define mem(a) memset(a,0,sizeof(a))
struct peijian{
int p;
int q;
}g[maxn][maxn];
m...
分类:
其他好文 时间:
2014-09-04 13:21:59
阅读次数:
135
partial关键字的用法:把partial放在class, struct, interface关键字的前面,以用来把类,结构,接口放在多个文件中。 // Program 位于两个不同的源文件BigClassPart1.cs和BigClassPart2.cs// BigClassPart1.csp....
分类:
其他好文 时间:
2014-09-04 13:11:19
阅读次数:
187
Qemu为virtio设备分配了专门的pci设备ID,device IDs (vendor ID 0x1AF4) from 0x1000 through 0x10FF,而pci子系统中的厂商ID和设备ID就成为了virtio类型和厂商域的组成,所以PCI驱动是不需要知道virtio设备类型的真正含义,对于Kernel来说只是注册了一个struct virtio_device,并挂载到了virtio...
分类:
Web程序 时间:
2014-09-04 11:47:59
阅读次数:
195
#include "stdafx.h"#includeusing namespace std;struct linklist { struct linklist* next; int data;};void remove(linklist *head);//去除重复项linklist *...
分类:
其他好文 时间:
2014-09-04 11:42:30
阅读次数:
169