AVL
arm不strong
一只土木狗的编程之路
展开
-
Contest100000614 - 《算法笔记》9.5小节——数据结构专题(2)->平衡二叉树(AVL)
题目链接问题 A: 算法9-9~9-12:平衡二叉树的基本操作AVL 树的基本操作,套用固定模板即可。参考代码如下。#include<iostream>#include<algorithm>using namespace std;struct node { int data; int height = 1; node* left = NULL;...原创 2019-02-18 18:05:31 · 166 阅读 · 0 评论 -
PAT A1120~A1123
一、PAT A1120Friend Numbers很简单啦。把每个数的 friend id 算出来用集合保存,集合里面会自动排序,最后输出即可。参考代码如下。#include<cstdio>#include<set>using namespace std;set <int> s;int main() { int n, t; scanf(...原创 2019-03-01 16:49:29 · 274 阅读 · 0 评论