集合及運算

可以用樹表示集合,樹的結點代表集合的元素 存儲結構 這裏採用數組的存儲形式 #define ElementType int typedef struct SetNode { ElementType data; ElementType parent; }SetType; int size=0; 創建集合 因爲創建不是要討論的核心,爲了方便,這裏採用了暴力的創建方法 爲了區分根結點以及哪個根結點更
相關文章
相關標籤/搜索