图同构。一个神奇的算法居然0ms过。真是不科学。反例可以构造出来。还是没有针对他的数据。#include #include #include #include using namespace std;struct position{ int x,y; }pos[10010];in...
分类:
其他好文 时间:
2014-07-22 22:55:55
阅读次数:
147
1 /** 2 * 二叉树的前序、中序、后序遍历的递归和非递归算法实现 3 **/ 4 5 //二叉链表存储 6 struct BTNode 7 { 8 struct BTNode *LChild; // 指向左孩子指针 9 ELEMENTTYPE ...
分类:
其他好文 时间:
2014-07-17 00:00:56
阅读次数:
241
- (NSString *)getLocalIP{
struct sockaddr_in sa;
socklen_t len = sizeof(sa);
if(getsockname(sockfd, (struct sockaddr *)&sa, &len))
{
NSLog(@"获取失败!");
}
return [NSS...
分类:
移动开发 时间:
2014-07-16 17:24:41
阅读次数:
238
#include #include typedef struct A{ int a:5; int b:3; unsigned c:8; unsigned d:8;} Type_A;/* VS2010, Windows XP, Debug模式下运行 */int main(void){ struc...
分类:
其他好文 时间:
2014-07-16 16:47:14
阅读次数:
210
在分析安卓源码过程中看到几处使用变长结构体的例子,比如下面的结构体:
struct command
{
/* list of commands in an action */
struct listnode clist;
int (*func)(int nargs, char **args);
int nargs;
char *args[1];
...
分类:
其他好文 时间:
2014-07-16 16:16:29
阅读次数:
381
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.#include#includeusing namespace std;struct ListNode ...
分类:
其他好文 时间:
2014-07-16 15:17:03
阅读次数:
188
尝试使用wptree来进行xml解析,又一次失败了,可以正常读取正常输出,但是使用wptree进行节点读取失败(乱码)请看源码:DealXml.h 1 #pragma once 2 3 #include 4 5 #include 6 7 struct TestData 8 { 9 ...
分类:
其他好文 时间:
2014-07-16 15:13:45
阅读次数:
225
1.声明一个学生类的 结构体struct Student{int age;char name[20];//长度为20的字符串int weiht;//像正常一样的申请变量,这个变量属于结构体的一部分};//这分号 必须有,不然报错结构体和类差不多,必须有对象才能操作,如:stcuct Stdent s...
分类:
其他好文 时间:
2014-07-16 14:55:59
阅读次数:
180
ovs 对于 OFPT_SET_CONFIG消息的处理过程非常简单,其实就是通过TCP协议(或其它)交换了几个整型值,而且交换机不需要对此消息进行回复;只需要解析出消息体(struct ofp_switch_config)然后设置max miss len 即可。通过分析Floodlight发送它的过程 和 OVS
处理它的过程,我们可以对openflow协议有更好的理解。下面是代码流程:
...
分类:
其他好文 时间:
2014-07-16 12:56:41
阅读次数:
260
#include #include using namespace std;struct Tire{ int num; Tire* next[26]; Tire() { num=0; int i; for(i=0;inext[t]==...
分类:
其他好文 时间:
2014-07-16 11:59:07
阅读次数:
245