数据结构.
tanlichun789
这个作者很懒,什么都没留下…
展开
-
PAT 树的遍历 1086. Tree Traversals Again
1086. Tree Traversals Again (25)时间限制200 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueAn inorder binary tree traversal can原创 2016-09-28 15:08:57 · 221 阅读 · 0 评论 -
已知前序中序,重建二叉树(加7种遍历的方式)
#include #include #include using namespace std;struct BinaryTreeNode { int m_nValue; BinaryTreeNode * m_pLeft; BinaryTreeNode * m_pRight;};//void CreateTree(BinaryTreeNode * & node)//{/转载 2018-01-10 21:22:07 · 220 阅读 · 0 评论 -
94. Binary Tree Inorder Traversal
Given a binary tree, return the inorder traversal of its nodes' values.Example:Input: [1,null,2,3] 1 \ 2 / 3Output: [1,3,2]Follow up: Recursive solution is trivial, could you do i...原创 2018-05-28 16:18:26 · 127 阅读 · 0 评论 -
116. Populating Next Right Pointers in Each Node
Given a binary treestruct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next;}Populate each next pointer to point to its next right node. If there is no next right node...原创 2018-06-26 15:37:18 · 177 阅读 · 0 评论 -
面试指南-公共字符串求值 (c++)
【题目】 给定一个字符串str,str表示一个公式,公式里可能有整数,加减乘除符号和左右括号,返回公式计算的结果。例如,str = 48×((70-65)-43)+8×1。返回-1816。【说明】可以认定给定的字符串一定是正确的公式,不需要对str做公式有效性检查。如果是负数就需要有括号括起来,比如4*(-3)。但如果负数作为公式的开头或者括号部分的开头,则可以没有括号,比如-3*4和(-3*4...原创 2018-07-07 21:54:16 · 452 阅读 · 0 评论