📄 sets.h
字号:
#pragma Sets
/* This module defines the the general Set type.
The majority of the procedures require that the sets be of the
same cardinality, being capable of holding the same number of elements
and the sets must cover the same low and high range to work correctly.
It also includes some convenient operators on character sets */
typedef void *Set;
void Open(Set &s, unsigned int low, unsigned int highRange);
/*Open: Allocates storage for your set, and initializes the set to be Null
Prior to using the following voids you must open your sets*/
void Close(Set &s);
/*Close: Deallocates storage for set, to reuse set you must open again*/
void Include(Set &s, unsigned int what);
/*Include: Adds individual element to set, element must be in range of set*/
void Exclude(Set &s, unsigned int what);
/*Exclude: Removes an element from set, element must be in range of set*/
void Union(Set &left, Set &right, Set &result);
/*Union: The union of left and right is placed in result set such that
result = left U right = {x| x E left or x E right or both} */
void Intersection(Set &left, Set &right, Set &result);
/*Intersection: The intersection of left and right placed in result
such that result = left^right = {x| x E left and x E right} */
boolean In(unsigned int what, Set s);
/*In: returns TRUE if element what is in set s*/
boolean Equal(Set &left, Set &right);
/*Equal: returns TRUE if sets left and right are equal*/
boolean Subset(Set &source, Set &target);
/*******SOFTWARE NOT COMPLETED FOR THIS void***********/
boolean Proper(Set &source, Set &target);
/*******SOFTWARE NOT COMPLETED FOR THIS void***********/
void Null(Set &s);
/*Null: removes all elements from set, s = EMPTY SET*/
void Diff(Set &left, Set &right, Set &result);
/*Diff: returns the difference left - right in set result*/
void SymDiff(Set &left, Set &right, Set &result);
/*SymDiff: returns the symetrical difference of left and right in
result, left <| right = {x|x E left or x E right, but not both}*/
void IncludeR(Set &s, unsigned int low, unsigned int highRange);
void ExcludeR(Set &s, unsigned int low, unsigned int highRange);
void Universe(Set &s);
/*Universe: Creates set element for entire range of set s*/
void LowerCase(Set &s);
/*LowerCase: places ordinal value of letters a..z in set s*/
void UpperCase(Set &s);
/*Upercase: places ordinal values of letters A..Z in set s*/
void Digit(Set &s);
/*Digit: places ordinal value of digits 0..9 in set s*/
void Alphabet(Set &s);
/*Alphabet: places ordinal value of a..zA..Z in set s*/
void Write(Set &set, char &s[]);
/*******SOFTWARE NOT COMPLETED FOR THIS void***********/
void Read(Set &set, char &s[]);
/*******SOFTWARE NOT COMPLETED FOR THIS void***********/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -