约瑟夫环形问题有30人将其编号,从头开始1,2,3数数,每到3将其删除,一共删去15个数。输出被删去的15个数#includeusing namespace std;struct LinkList{ int val; LinkList* next; LinkList(int a):val(a)...
分类:
其他好文 时间:
2014-07-09 23:43:04
阅读次数:
246
以下是最近学习各种算法的代码实现:#include #include #include #include typedef int EleType;typedef int (*CompFunc)(void *,void *);int IntComp(void * a,void *b){ if(*...
分类:
其他好文 时间:
2014-07-08 00:15:54
阅读次数:
293
源代码下载地址:挂钩SSDT源代码 据微软所言,服务描述符表是一个由四个结构组成的数组,其中的每一个结构都是由四个双字项组成。因此,我们可以将服务描述符表表示为:typedef struct ServiceDescriptorTable{ SDE ServiceDescriptor[4];}SDT....
分类:
其他好文 时间:
2014-07-07 23:56:51
阅读次数:
367
栈:是一种后进先出(LIFO)的结构,对其插入删除只能在栈顶进行;链表实现节点:#include#includetypedef struct Node *PtrToNode;typedef PtrToNode Stack;struct Node{ int Element; struct No...
分类:
其他好文 时间:
2014-07-07 23:48:05
阅读次数:
224
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointe...
分类:
其他好文 时间:
2014-07-07 23:09:49
阅读次数:
298
字典树。 1 #include 2 #include 3 #include 4 5 #define MAXN 50005 6 #define MAXL 25 7 8 typedef struct Trie { 9 bool f;10 Trie *next[26];11 ...
分类:
其他好文 时间:
2014-07-07 21:20:46
阅读次数:
181
二叉树的前序遍历:root点先被访问,然后是left和right子节点。迭代的版本也相对好写。1、递归版本:时间复杂度O(N),空间复杂度O(N) 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int va...
分类:
其他好文 时间:
2014-07-07 20:35:24
阅读次数:
158
二叉树的中序遍历1、递归版本/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) :...
分类:
其他好文 时间:
2014-07-07 20:00:20
阅读次数:
161
1. [代码][C/C++]代码 //这里创建一个圆角矩形的按钮 UIButton *button1 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; // 能够定义的button类型有以下6种,// typedef enum {// ...
分类:
移动开发 时间:
2014-07-07 19:00:16
阅读次数:
238
这道题目各种wa。首先是错了一个坐标,居然没测出来。然后是剪枝错误。搜索pen时就返回,可能还存在串pen*。 1 #include 2 #include 3 #include 4 5 #define MAXN 1005 6 7 typedef struct Trie { 8 in...
分类:
其他好文 时间:
2014-07-07 18:07:44
阅读次数:
210