摘要: 查找不存在的元素 左边比它小,右边比它大 阅读全文
posted @ 2024-10-18 22:44 某朝 阅读(9) 评论(0) 推荐(0)
摘要: #include <math.h> #include <iostream> #include <algorithm> #include <fstream> #include <iomanip> #include <string> #include <vector> #include <queue> 阅读全文
posted @ 2024-10-18 17:53 某朝 阅读(6) 评论(0) 推荐(0)
摘要: Description 给出一棵二叉树的中序遍历和每个节点的父节点,求这棵二叉树的先序和后 序遍历。 Input 输入第一行为一个正整数 n 表示二叉树的节点数目, 节点编号从 1 到 n,其中 1 为根节点。 第 2 行有 n 个数字, 第 i 个数字表示 i 的父亲节点。( 1 的父亲节点为 0 阅读全文
posted @ 2024-10-18 17:48 某朝 阅读(38) 评论(0) 推荐(0)