![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
WA
文章平均质量分 79
ComBoat
俺好菜呀o(╥﹏╥)o
展开
-
是否同一棵二叉搜索树
描述 给定一个插入序列就可以唯一确定一棵二叉搜索树。然而,一棵给定的二叉搜索树却可以由多种不同的插入序列得到。例如分别按照序列{2, 1, 3}和{2, 3, 1}插入初始为空的二叉搜索树,都得到一样的结果。于是对于输入的各种插入序列,你需要判断它们是否能生成一样的二叉搜索树。 输入格式: 输入包含若干组测试数据。每组数据的第1行给出两个正整数N (≤10)和L,分别是每个序列插入元素的个数和需要检查的序列个数。第2行给出N个以空格分隔的正整数,作为初始插入序列。最后L行,每行给出N个插入的元素,属于L个需原创 2021-02-27 09:31:37 · 288 阅读 · 0 评论 -
Root of AVL Tree
description An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by more than one, rebalancing is done to restore this property. Figures 1-4原创 2021-02-27 15:46:56 · 89 阅读 · 0 评论 -
CodeForce 659B Qualifying Contest
题目描述 Very soon Berland will hold a School Team Programming Olympiad. From each of the m m Berland regions a team of two people is invited to participate in the olympiad. The qualifying contest to form teams was held and it was attended by n n Berland stude原创 2021-02-20 10:06:19 · 99 阅读 · 0 评论 -
POJ 1033 Defragment(模拟)
Description You are taking part in the development of a “New Generation” operating system and the NG file system. In this file system all disk space is divided into N clusters of the equal sizes, numbered by integers from 1 to N. Each file occupies one or原创 2021-02-17 22:42:19 · 232 阅读 · 0 评论