算法与数据结构的深入学习(A-1)

写在最前面:为了提升自己编程以及软件设计的水平,决定从最基础的数据结构与算法入手。通过翻译,学习,

Dictionary of Algorithms and Data Structures》字典来提升自己。

A: absolute performance guarantee

绝对性能优先算法

approximation algorithm

近似算法

Definition: An approximation algorithm will return a solution at most a bounded amount more (or less, as appropriate) than the optimum.

一个近似的算法返回的解大于,小于或者等于最优解。

optimal solution

最优解

A:abstract data type

抽象数据类型  缩写ADT

Definition: A set of data values and associated operations that are precisely specified independent of any particular implementation.

一组数值与其相关的操作可以实现某些特定的任务。

Specialization 
dictionarystackqueuepriority queuesetbag.

字典,堆栈,队列,优先级队列(带权队列),集合,包。

axiomatic semantic

公理定义

Note: Since the data values and operations are defined with mathematical precision, rather than as an implementation in a computer language, we may reason about effects of the operations, relations to other abstract data types, whether a program implements the data type, etc.

所有的数值和操作都用数学方法定义的,而不是用计算机语言来实现的,所以我们实现的这些抽象数据类型以及操作,没有使用任何一中计算机语言。例如:

One of the simplest abstract data types is the stack. The operations new(), push(v, S), top(S), and popOff(S) may be defined with axiomatic semantics as following.

  1. new() returns a stack
  2. popOff(push(v, S)) = S
  3. top(push(v, S)) = v
一个简单的抽象数据类型的堆栈。 new(), push(v, S), top(S), and popOff(S)这些操作都是建立在公理定义之上的。


where S is a stack and v is a value. (The usual pop operation is a combination of top, to return the top value, and popOff, to remove the top value.) Contrast this with the axiomatic semanticsdefinition of a set, a dictionary, or a queue.

定义S为堆栈 V位值。(通常使用POP操作来取得堆栈顶端的数据,并使用popOff来移除它。)我们使用同样的公理来定义一个集合,字典,或者是队列。(这里指的应该不使用任何计算机语言,而是用数学方式定义)。

From these axioms, one may define equality between stacks, define a pop function which returns the top value in a non-empty stack, etc. For instance, the predicate isEmpty(S) may be added and defined with the following additional axioms.

  1. isEmpty(new()) = true
  2. isEmpty(push(v, S)) = false

基于公理,需要定义更多的堆栈比较方法,定义一个pop方法返回当堆栈不为空时堆栈顶部值的方法。所以我们可以断言isEmpty(S)这个方法将要定义并添加到公理当中。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值