摘要:
A binary tree is a finite set of vertices that is either empty or consists of a root r and two disjoint binary trees called the left and right subtree 阅读全文
摘要:
度度熊正在学习双端队列,他对其翻转和合并产生了很大的兴趣。 初始时有 N 个空的双端队列(编号为 1 到 N ),你要支持度度熊的 Q 次操作。 ①1 u w val 在编号为 u 的队列里加入一个权值为 val 的元素。(w=0 表示加在最前面,w=1 表示加在最后面)。 ②2 u w 询问编号为 阅读全文