//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
题目是这样的:给你一个单链表的表头,再给你其中某个结点的指针,要你删除这个结点,条件是你的程序必须在O(1)的时间内完成删除。
由于有的同学对链表还不是很熟悉,本文尽量描述的通俗易懂,老鸟请直接跳过前面一大段。
链表结构如下:
struct node
{
int val;
node* next;
};
题目不是很难,很快就能想到好办法:)
首先回顾一下普通的删除方法,...
分类:
其他好文 时间:
2014-08-02 05:14:14
阅读次数:
231
First I implemented it by QuickSort, but got a TLE:class Solution {public: struct Pair { Pair(ListNode *pS, ListNode *pE) : pStart(pS), p...
分类:
其他好文 时间:
2014-08-02 05:04:32
阅读次数:
233
1.虚指针和虚函数表 1.1不含有任何数据成员或者虚函数的class或者struct大小为1,含有虚函数的对象在基地址部分有一个vptr,指向虚函数表,因此大小为4个字节。 1.2动态绑定的原理:假设派生类和基类存在覆盖的关系(基类中定义了虚函数),那么派生类在虚函数表中,会覆盖掉基类相应的虚函.....
分类:
编程语言 时间:
2014-08-02 01:47:42
阅读次数:
356
#include#include#includeusing namespace std;struct node{ int a; char s[105]; }p[105];int cmp(node c,node b){ return c.a #include #inclu...
分类:
其他好文 时间:
2014-08-02 01:42:32
阅读次数:
246