摘要: 剑指offer第8题,本来想找leetcode上对应的题,后来没找到,直接去牛客网上刷了。 题目描述: 给定一个二叉树和其中的一个结点(pNode),请找出中序遍历顺序的下一个结点并且返回。注意,树中的结点不仅包含左右子结点,同时包含指向父结点的指针。 分析 我看到这道题的第一个想法,就是不用管左子 阅读全文
posted @ 2019-09-18 21:19 HaoPeng_Zhang 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. For exa 阅读全文
posted @ 2019-09-18 17:41 HaoPeng_Zhang 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 最近在读C++ primer的时候,发现p32上写道:当我们赋给无符号类型一个超出它表示范围的值时,结果是初始值对无符号类型表示数值总数取模后的余数。因此,把 1赋值给8比特大小的unsigned char所得的结果是255。 1怎么取模?   这里先明确一下取模和取余的区别:( 阅读全文
posted @ 2019-09-18 15:18 HaoPeng_Zhang 阅读(1331) 评论(0) 推荐(0) 编辑