Set.h
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;#ifndef Set_H
#define Set_H//定义适合本文的集合(Set)抽象数据类型--------------------------------------------
class Set
{
public:
Set():vec(0){};
Set(int A[], int n); //用数组初始化集合
Set(const Set &s); //用集合初始化集合
Set(vector<int> v);
const Set& operator=(const Set& s); //集合赋值运算符重载 bool IsEmpty(); //判断集合是否为空集
int Card(); //计算集合A的模
void Clear(); //集合清空
int Find(int a); //在集合中查找元素a,返回位置,不存在返回-1
int KeyAt(int i); //返回集合中i位置的key
void SetKey(int index, int Val); //设置index位置的值为Val
void Sort(); //对集合中的元素按从小到大排序
void Remove(int a); //在集合中删除元素a得到新的集合
void Add(int a); //在集合中添加元素a得到新的集合
bool BelongTo(Set &s); //判断集合A是否属于集合B
bool operator==(Set &s); //判断两个集合是否相等
Set Sub(Set &s)const; //集合A减B计算
Set Union(Set &s)const; //集合A并B计算
Set InterSect(Set &s)const; //集合A交B的计算 Set ValueOfAttribute(); //求属性a值集的值域
vector<int> ToIntVector(); //把该集合转化成整型向量 void Print(); //在屏幕打印集合A
private:
vector<int> vec;
};#endif
表面粗糙度计算 python
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
下一篇:查看某一个远程镜像详情

提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
a5m2中连接postgre数据的方式
一、工作环境以及所需软件: Informix Sever: 测试db Server为 JDBC Driver : JDBC.2.21.JC5.tar WSAD: WIN 2000 + WSAD5.1 二、创建步骤: 步骤一: 获取 DB Server
a5m2中连接postgre数据的方式 informix server html 数据库