单链表的节点结构一般如下:struct Node{ int val; Node* next;};在处理单链表的基本操作要注意以下事项:1、记住头节点单链表的每个操作都要从头节点开始。如果函数内头节点发生了改变,比如在头节点之前插入节点,删除头节点,反转链表等,都需要更新头节点...
分类:
其他好文 时间:
2014-06-27 19:46:49
阅读次数:
368
语言:C++描述:使用单链表实现,HeadNode是key=-1,value=-1,next=NULL的结点。距离HeadNode近的结点是使用频度最小的Node。 1 struct Node { 2 int key; 3 int value; 4 Node* next; 5...
分类:
其他好文 时间:
2014-06-27 18:48:42
阅读次数:
209
题目:输入一棵二叉树的根节点,求该树的深度题解分析:二叉树具有天然的递归性,首先应该想递归解法/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNod...
分类:
其他好文 时间:
2014-06-27 15:58:59
阅读次数:
206
要理解两者的区别,就要分别理解他们的本质strlen(char *) 计算字符串的长度,内部实现是用一个循环计算字符串的长度,直到‘\0’为止1.srtlen 是一个函数,参数只能为char 或者 string (sizeof是运算符,可以对好多类型作sizeof,如struct, class等)2...
分类:
编程语言 时间:
2014-06-27 15:32:40
阅读次数:
246
http://acm.hdu.edu.cn/showproblem.php?pid=1879#include #include #include #include #include using namespace std;int n,tt;int tx[102],ty[102];struct nod...
分类:
其他好文 时间:
2014-06-27 00:54:20
阅读次数:
233
http://acm.hdu.edu.cn/showproblem.php?pid=1372以前真二,模板题OJ真奇怪,有时能A有时W,#include #include #include #include using namespace std;struct node{ int x,y,z;...
分类:
其他好文 时间:
2014-06-26 12:17:50
阅读次数:
161
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define inf 0x3f3f3f3f
#define ll __int64
#define mod 1000000007
using namespace std;
struct node
{
int x...
分类:
其他好文 时间:
2014-06-26 11:48:43
阅读次数:
214
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define inf 0x3f3f3f3f
#define ll __int64
#define mod 1000000007
using namespace std;
struct node
{
int x...
分类:
其他好文 时间:
2014-06-26 11:39:45
阅读次数:
206
简述:0、ext2格式。1、包括权限管理,精确到角色。2、数据块采用连续分配(离散分配大家来弄吧)。3、为实现间接索引,相信实现了目录,简介索引也不是问题吧。。4、删除目录不支持递归删除。自己写去吧。5、整体结构:6、主要数据结构://超级块struct SuperBlock{ int s_b...
分类:
系统相关 时间:
2014-06-26 11:18:45
阅读次数:
301
oc是c的超集,从c扩展而来,具备面向对象的特性,比如类,消息,单继承。c的部分:数据类型:short,int,long,float,double,char,pointer,struct常用方法:readline()atoi()sizeof()malloc()oc的部分:receiver:classNameOrObjectselector:method消息的传递通过[recei..
分类:
移动开发 时间:
2014-06-26 06:39:56
阅读次数:
305