加拿大二年级计算机专业的家庭作业~ 大家帮忙看看。

mylzw mylzw 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
1.Specify the abstract data type LIST with the following operations
* null: denotes the empty list
* add: inserts a sort of NAT into the list
* del: deletes an element in the list at a certain position
* length: returns the length of the list
* append: add two lists together
* sum: returns the sum of the natural numbers stored in the list
* isEMPTY: return whether the list is empty

specify the NAT and BOOLEAN first

2.Specify the abstract data type SET with the following operations

* null: denotes the empty set
* add: adds one element to the set
* insert: inserts one element to the set
* remove: deletes one element from the set
* card: returns the union of two sets
* intrsct: returns the intersection of two sets
* isIN: returns whether an element is in the set

The element is NAT

3.Specify the abstract data type BITREE(binary tree)with the following operations
* empty: denotes the empty tree
* add: creates a binary tree(input is one element and two binary trees,output is a binary tree
with the elemnet as the root and two input trees as the two subtrees)
* left: returns the left subtree
* right: returns the right subtree
* isIN: returns whether an element is in the tree

The element is NAT

直接给答案就可以,~ 最好加注释。
...全文
评论 33
收藏 已收藏
分享
返回顶部
mylzw
VC/MFC 16,551 成员 421,605 内容