摘要:
1.二叉树按层遍历2.二叉树添加兄弟指针3.在二叉树中查找LCA(最近公共祖先)3.在排序二叉树中找到大于N且最接近N的数// PrintByLevel.cpp : Defines the entry point for the console application.// Author : yangyh#include "stdafx.h"#include <iostream>#include <queue>using namespace std;typedef struct _node_st{ int value; _node_st* pLeft 阅读全文
posted @ 2011-09-29 21:03
yangyh
阅读(1241)
评论(0)
推荐(1)
摘要:
#ifndef Max(x,y)#define Max(x,y) (__extension__({typeof(x) __X=(x);typeof(y) __Y=(y);__X>__Y?__X:__Y;}))#endif 顺便问一下标准C下如何安全地定义呢? 阅读全文
posted @ 2011-09-29 11:38
yangyh
阅读(865)
评论(0)
推荐(0)
浙公网安备 33010602011771号