首页 > 代码库 > ADT(abstract data types)抽象数据类型
ADT(abstract data types)抽象数据类型
1、What is it?
An abstract data type is a set of objects together with a set of operations.
抽象数据类型是带有一组操作的一组对象的集合。
ADTS=objects+operations
2、How to define?
ADT Name Describe of data; Operations;End ADT
Operations description:Name(parameter list) Input: data used to input Output: data used to output Pre-condition: if the condiont my not be satisfied, the operation may not be correct Post-condition: The status after the operation be executed
3、Example
ADT Bigint Data n: 0..2^54-1 Operations: addone Pre-condition: n+1<2^54; Post-condition: n=n+1; subone Pre-condition: n>0; Post-condition: n=n-1; mult(x,y) Input: (x:Bigint); Output: (y:Bigint); Pre-condition: n*x.n<2^54; Post-condition: y.n=n*x.n;End ADT
ADT(abstract data types)抽象数据类型
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。