摘要:
http://www.itint5.com/oj/#27用了基于stack的中序遍历,记录一下last,就很简单了。#include /*树结点的定义(请不要在代码中定义该结构)struct TreeNode { TreeNode *left, *right; bool isLeftThread, isRightThread;}*/void convertToThreadedTree(TreeNode *root) { stack stak; TreeNode *n = root; TreeNode *last = NULL; while (n != NULL ||... 阅读全文
posted @ 2014-01-21 21:21
阿牧遥
阅读(263)
评论(0)
推荐(0)

浙公网安备 33010602011771号