随笔分类 -  数据结构

清华机试-二叉树遍历
摘要:题目描述 编一个程序,读入用户输入的一串先序遍历字符串,根据此字符串建立一个二叉树(以指针方式存储)。 例如如下的先序遍历字符串: ABC##DE#G##F### 其中“#”表示的是空格,空格字符代表空树。建立起此二叉树以后,再对二叉树进行中序遍历,输出遍历结果。 输入描述: 输入包括1行字符串,长 阅读全文

posted @ 2018-04-08 23:05 Tracy-mac 阅读(180) 评论(0) 推荐(0) 编辑

leetcode 3 Longest Substring Without Repeating Characters
摘要:题目: Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the 阅读全文

posted @ 2018-04-06 21:27 Tracy-mac 阅读(90) 评论(0) 推荐(0) 编辑

leetcode 2 Add Two Numbers(链表)
摘要:题目: 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 阅读全文

posted @ 2018-01-20 15:04 Tracy-mac 阅读(100) 评论(0) 推荐(0) 编辑

csuoj Binary Search Tree analog
摘要: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 阅读全文

posted @ 2017-06-10 00:31 Tracy-mac 阅读(119) 评论(0) 推荐(0) 编辑

csuoj-1869-树上最大值
摘要:题目: Description 现在给你一棵根节点编号为1的树,每个节点上都有对应的权值, 求出树上每一层的最大值。(根节点所在位置视为第一层,由此可推,根节点的儿子是处于第二层,etc) Input 多组数据读入 第一行输入一个正整数n表示树上有n个节点(n<=100000),下一行输入n个正整数 阅读全文

posted @ 2017-04-16 00:44 Tracy-mac 阅读(219) 评论(0) 推荐(0) 编辑

csuoj-1010-Water Drinking
摘要:题目: 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 阅读全文

posted @ 2017-04-10 21:16 Tracy-mac 阅读(113) 评论(0) 推荐(0) 编辑

csuoj-1005-Binary Search Tree analog
摘要:题目: 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 阅读全文

posted @ 2017-04-10 20:55 Tracy-mac 阅读(233) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示