题意:对trees有四种操作。 1 u v ,将包含u th树的森林和含有v th树的森林 合并 在一起; u ,将u th树与森林分开; 3 u ,查询包含u th树的森林的大小; 4 u v ,查询u th树和v th树是否在同一林中。 【分析】:给每个点都给他们造一个编号w,删除点,就相当于该 ...
分类:
其他好文 时间:
2018-04-30 22:44:12
阅读次数:
202
t’s universally acknowledged that there’re innumerable trees in the campus of HUST. Thus a professional tree manager is needed. Your task is to write ...
分类:
其他好文 时间:
2018-04-30 19:46:46
阅读次数:
155
[抄题]: Given a binary search tree (BST) with duplicates, find all the mode(s) (the most frequently occurred element) in the given BST. Assume a BST is ...
分类:
其他好文 时间:
2018-04-30 11:55:36
阅读次数:
127
题目描述 Bessie is leading the cows in an attempt to escape! To do this, the cows are sending secret binary messages to each other. Ever the clever counte ...
分类:
其他好文 时间:
2018-04-30 11:44:15
阅读次数:
179
XOR is a kind of bit operator, we define that as follow: for two binary base number A and B, let C=A XOR B, then for each bit of C, we can get its val ...
分类:
其他好文 时间:
2018-04-29 16:19:25
阅读次数:
447
Given a binary tree Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL ...
分类:
其他好文 时间:
2018-04-29 13:31:42
阅读次数:
162
一、mysql的二进制日志文件 二、查看二进制日志文件信息: 1、查看二进制日志文件是否开启:show variables like 'log_bin'; 2、查看所有二进制日志文件的列表:show binary logs; 3、查看当前二进制日志文件的名称(最后一个):show master st ...
分类:
数据库 时间:
2018-04-29 13:18:45
阅读次数:
205
question: 分析: 先根遍历 try: result: conclusion: ...
分类:
其他好文 时间:
2018-04-29 11:49:26
阅读次数:
178
函数的参数 局部变量和全局变量 递归函数和匿名函数 高阶函数 函数式编程了解 一、函数的各种参数 关键参数和位置参数:只要记住关键参数必须要放在位置参数后面就行了 非固定参数(可变参数?):*args,**kwargs 二、局部变量和全局变量 针对数字、字符串这样的变量,在函数内部的参数的改变不会影 ...
分类:
编程语言 时间:
2018-04-28 15:40:26
阅读次数:
238