struct Node{ int data; Node *next;};//创建链表 输入为数字,如果输入0 链表结束(0不计)Node *creat(){ Node *head,*p,*s; int x,cycle=1; head=(Node *)malloc(siz...
分类:
其他好文 时间:
2014-08-02 20:50:24
阅读次数:
292
众所周知,进程调度使用schedule()函数来完成,下面我们从分析该函数开始,代码如下(kernel/sched/core.c):1 asmlinkage __visible void __sched schedule(void)2 {3 struct task_struct *tsk =...
分类:
系统相关 时间:
2014-08-02 17:58:03
阅读次数:
396
//25...9.4.
//4.71.3..6
//8.34.759.
//3.8.7..69
//.1.3.24..
//5.49.6.83
//9.6.3.7.8
//.3.6.8.1.
//1.2.9.6.4
struct node
{
node(int r,int c):row(r),col(c) {}
friend ostream& operator <<(ostr...
分类:
其他好文 时间:
2014-08-02 15:31:53
阅读次数:
272
双向链表的结点包含前驱指针和后继指针,队列入队操作是在双向链表尾部添加元素,队列的出队操作是把双向链表的头结点删除,判断队列是否为空只要判断双向链表的头指针是否指向了NULL即可。
# include
# include
using namespace std;
struct queueNode
{
int val;
queueNode *pre;
queueNode *next;...
分类:
其他好文 时间:
2014-08-02 12:55:03
阅读次数:
193
#include
#include
#include
#include
#define CHOICE 2
#define FILEPATH "/root/date.c"
char global_buffer[120];
//NO.1 使用全局声明的数组
#if CHOICE == 1
char *local_time(char* filename)
{
struct tm ...
分类:
其他好文 时间:
2014-08-02 12:48:53
阅读次数:
220
问题:二叉树中序遍历递归实现/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) :...
分类:
其他好文 时间:
2014-08-02 12:40:33
阅读次数:
162
linux kernel/user mode data struct learning
分类:
系统相关 时间:
2014-08-02 12:33:23
阅读次数:
564
#include
#include
#define maxn 10002
int ans, queue[maxn];
struct Node{
int to, next, val;
} map[maxn << 1];
struct node{
int first, money, indegree;
} head[maxn];
bool topoSort(int n)
{...
分类:
其他好文 时间:
2014-08-02 10:07:43
阅读次数:
196
http://community.topcoder.com/stat?c=problem_statement&pm=13245就是有字符串,里面的字符可以随意两两消除,如果不等的话,那么最后如果留下一个字符,这个字符就是winning letter。如果任意方法消除都是这个winning lette...
分类:
移动开发 时间:
2014-08-02 09:50:23
阅读次数:
248
题目是这样的:给你一个单链表的表头,再给你其中某个结点的指针,要你删除这个结点,条件是你的程序必须在O(1)的时间内完成删除。
由于有的同学对链表还不是很熟悉,本文尽量描述的通俗易懂,老鸟请直接跳过前面一大段。
链表结构如下:
struct node
{
int val;
node* next;
};
题目不是很难,很快就能想到好办法:)
首先回顾一下普通的删除方法,...
分类:
其他好文 时间:
2014-08-02 05:14:14
阅读次数:
231