/** * Copyright (c): Uwe Schmidt, FH Wedel * * You may study, modify and distribute this source code * FOR NON-COMMERCIAL PURPOSES ONLY. * This copyright message has to remain unchanged. * * Note that this document is provided 'as is', * WITHOUT WARRANTY of any kind either expressed or implied. */ #ifndef SET_H__ #define SET_H__ /*--------------------*/ #include "Element.h" typedef struct Node *Set; struct Node { enum { RED, BLACK } color; Element info; Set l; Set r; }; /*--------------------*/ extern Set mkEmptySet(void); extern int isEmptySet(Set s); extern Set mkOneElemSet(Element e); extern Set insertElem(Element e, Set s); extern int isInSet(Element e, Set s); extern unsigned int card(Set s); extern unsigned int maxPathLength(Set s); extern unsigned int minPathLength(Set s); extern int invSetAsRedBlackTree(Set s); /*--------------------*/ #endif