摘要:题目描述 编一个程序,读入用户输入的一串先序遍历字符串,根据此字符串建立一个二叉树(以指针方式存储)。 例如如下的先序遍历字符串: ABC##DE#G##F### 其中“#”表示的是空格,空格字符代表空树。建立起此二叉树以后,再对二叉树进行中序遍历,输出遍历结果。 输入描述: 输入包括1行字符串,长
阅读全文
摘要:题目: Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the
阅读全文
摘要:题目: You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes co
阅读全文
摘要:Description Binary Search Tree, abbreviated as BST, is a kind of binary tree maintains the following property: each node has a Key value, which can be
阅读全文
摘要:题目: Description 现在给你一棵根节点编号为1的树,每个节点上都有对应的权值, 求出树上每一层的最大值。(根节点所在位置视为第一层,由此可推,根节点的儿子是处于第二层,etc) Input 多组数据读入 第一行输入一个正整数n表示树上有n个节点(n<=100000),下一行输入n个正整数
阅读全文
摘要:题目: Description The Happy Desert is full of sands. There is only a kind of animal called camel living on the Happy Desert. Cause they live here, they
阅读全文
摘要:题目: Description Binary Search Tree, abbreviated as BST, is a kind of binary tree maintains the following property: each node has a Key value, which ca
阅读全文