摘要: L2-012 关于堆的判断 将一系列给定数字顺序插入一个初始为空的小顶堆H[]。随后判断一系列相关命题是否为真。命题分下列几种: x is the root:x是根结点; x and y are siblings:x和y是兄弟结点; x is the parent of y:x是y的父结点; x i 阅读全文
posted @ 2023-01-23 14:57 椿の花少年 阅读(40) 评论(0) 推荐(0)
摘要: 用sort对结构体进行排序步骤如下 1.先写c++头文件 # include<iostream># include<algorithm> //这个是sort的头文件 using namespace std; 2.定义一个结构体 eg:struct node{int x;int y; }a[105]; 阅读全文
posted @ 2023-01-15 16:34 椿の花少年 阅读(52) 评论(0) 推荐(0)