计算机专业英语一DataStructu.ppt
Computer English,Chapter 4 Data Structure,计算机专业英语,4-2,Key points:useful terms and definitions of data structureDifficult points:Stack,queue,tree,计算机专业英语,4-3,Requirements:,1.Three reasons for using data structures are efficiency,abstraction,and reusability.,2.The properties of Stack,Queue,and Tree,3.掌握常用英汉互译技巧,计算机专业英语,4-4,New Words&Expressions:harsh table 杂凑(哈希)表priority queues 优先队列reusability n.复用性binary tree 二叉树traversing 遍历,走过context-free 与上下文无关,4.1 An Introduction to Data Structures,计算机专业英语,4-5,Data comes in all shapes and sizes,but often it can be organized in the same way.For example,consider a list of things to do,a list of ingredients in a recipe,or a reading list for a class.Although each contains a different type of data,they all contain data organized in a similar way:a list.A list is one simple example of a data structure.Of course,there are many other common ways to organize data as well.In computing,some of the most common organizations are linked lists,stacks,queues,sets,hash tables,trees,heaps,priority queues,and graphs.Three reasons for using data structures are efficiency,abstraction,and reusability.,数据以各种形状和大小出现,但是它常常可以用同样的方式来组织。例如,考虑要做事情的列表、处方成份的清单或一个班级的阅读目录。虽然它们包含不同类型的数据,但他们都包含以一种相似方式组织的数据:一个列表。列表是数据结构的一个简单例子。当然,还有许多其他组织数据通用方法。在计算机技术中,一些最常用的组织方式是链接表、堆栈、队列、集合、哈希表、树、堆、优先队列和图。使用数据结构的三个原因是效率、抽象性和复用性。,4.1 An Introduction to Data Structures,计算机专业英语,4-6,Efficiency Data structures organize data in ways that make algorithms more efficient.For example,consider some of the ways we can organize data for searching it.One simplistic approach is to place the data in an array and search the data by traversing element by element until the desired element is found.However,this method is inefficient because in many cases we end up traversing every element.By using another type of data structure,such as a hash table or a binary tree we can search the data considerably faster.,效率数据结构使用令算法更有效率的方法组织数据。例如,考虑一些我们用来查找数据的组织方式。一种过分简单的方式是将数据放置到数组中,并用遍历的方法找到需要的元素。然而,这种方法是低效率的,因为在许多情况下,我们需要遍历所有元素才能完成。使用其他类型的数据结构,如哈希表和二叉数,我们能够相当快速地搜寻数据。,4.1 An Introduction to Data Structures,计算机专业英语,4-7,Abstraction Data structures provide a more understandable way to look at data;thus,they offer a level of abstraction in solving problems.For example,by storing data in a stack,we can focus on things that we do with stacks,such as pushing and popping elements,rather than the details of how to implement each operation.In other words,data structures let us talk about programs in a less programmatic way.,抽象化数据结构提供一个更好理解的方法查看数据;因此,它们在解决问题中提供一定的抽象化水平。例如,通过把数据储存在堆栈中,我们可以将重点集中在对堆栈的操作上,如使元素进栈和出栈,而不是集中在实现操作的细节上。换句话说,数据结构使我们以较少的编程方式谈论程序。,4.1 An Introduction to Data Structures,计算机专业英语,4-8,Reusability Data structures are reusable because they tend to be modular and context-free.They are modular because each has a prescribed interface through which access to data stored in the data structure is restricted.That is,we access the data using only those operations the interface defines.Data structures are context-free because they can be used with any type of data and in a variety of situations or contexts.In C,we make a data structure store data of any type by using void pointers to the data rather than by maintaining private copies of the data in the data structure itself.,复用性:因为数据结构趋向于模块化并和环境无关,所以数据结构是可以复用的。因为每种结构有一个预定的接口,通过该接口限制访问存储在数据结构中的数据,所以它们是模块化的。也就是说,我们只能使用接口定义的那些操作来访问数据。因为数据结构能用于任何类型的数据,并用于多种环境中,所以数据结构与使用环境无关。在C语言中,我们通过使用空指针,而不是通过维护非公开的数据备份,使数据结构存储任何类型的数据。,4.1 An Introduction to Data Structures,计算机专业英语,4-9,New Words&Expressionsinviting adj.引人动心的contiguous adj.邻近的,接近的stack n.堆栈insertion n.插入deletion n.删除,删除部分pop 退栈push 进栈backtrack v.回溯pseudocode n.计伪代码retrieve v.重新得到;n.找回pointer n.指针pertinent adj.有关的,相干的,中肯的extract vt.取,引 back out 返回entail vt.使承担,带来traverse v.遍历shrink v.收缩allot vt.分配,充当,依靠predecessor n.前辈,前任back and forth adv.来来往往地,来回地vacancy n.空,空白,空缺stuff vt.填充,塞满AbbreviationsLIFO(last-in,first-out)后进先出FIFO(first-in,first-out)先进先出,4.2 Stacks,计算机专业英语,4-10,One of the properties of a list that makes a linked structure more inviting than a contiguous one is the need to insert and delete entries inside the list.Recall that it was such operations that had the potential of forcing the massive movement of names to fill or create holes in the case of a contiguous list.If we restrict such operations to the ends of the structure,we find that the use of a contiguous structure becomes a more convenient system.An example of this phenomenon is a stack,which is a list in which all insertions and deletions are performed at the same end of the structure.A consequence of this restriction is that the last entry entered will always be the first entry removed-an observation that leads to stacks being known as last-in,first-out(LIFO)structures.,插入和删除记录的需求是使链接表结构比邻接表结构更诱人的原因之一。让我们回想一下在邻接表中具有填补和创建存储空缺能力的操作。如果我们限制这种操作只可以在结构的尾部进行,则邻接表就是一种比较方便的系统。这种现象的一个例子就是堆栈。在堆栈中,插入和删除操作都在结构的相同末端进行。如此限制的结果就是最后一个进入表的记录也就是第一个从表中删除的记录。这种结构称为后进先出结构。,4.2 Stacks,计算机专业英语,4-11,The end of a stack at which entries are inserted and deleted is called the top of the stack.The other end is sometimes called the stacks base.To reflect the fact that access to a stack is restricted to the topmost entry,we use special terminology when referring to the insertion and deletion operations.The process of inserting an object on the stack is called a push operation,and the process of deleting an object is called a pop operation.Thus we speak of pushing an entry onto a stack and popping an entry off a stack.,堆栈尾部可以进行插入和删除操作的记录称为堆栈的栈顶,另一端叫做栈底。为了表示如何限制堆栈只能从栈顶访问,我们用一种特殊的术语来表示插入和删除操作。把一个对象插入堆栈的操作称为进栈操作,而从堆栈中删除一个对象的操作称为出栈操作,所以我们常说将一个条目进栈或者将其出栈。,4.2 Stacks,计算机专业英语,4-12,Stack ImplementationTo implement a stack structure in a computers memory,it is customary to reserve a block of contiguous memory cells large enough to accommodate the stack as it grows and shrinks.(Determining the size of this block can often be a critical decision.If too little room is reserved,the stack ultimately exceeds the allotted storage space;if too much room is reserved,memory space will be wasted.)One end of this block is designated as the stacks base.It is here that the first entry pushed on the stack is stored,with each additional entry being placed next to its predecessor as the stack grows toward the other end of the reserved block.,栈的实现为了在计算机存储中实现栈结构,一般采取的方法是保留一块足够容纳栈大小变化的内存单元。(通常来说,确定块的大小是一个很重要的任务。如果保留的空间过小,那么栈最后可能从所分配的存储空间中溢出;而如果保留的空间过大,又是一种浪费。)块的一端作为栈底,栈的第一条数据会被存储在这里,以后的条目被依次放置在它之后的存储单元中,也就是堆栈向另外一端增加。,4.2 Stacks,计算机专业英语,4-13,A programmer would probably find it advantageous to write procedures that perform these push and pop operations so that the stack could be used as an abstract tool.Note that these procedures should handle such special cases as attempts to pop entries from an empty stack and to push entries onto a full stack.In particular,a complete stack system would probably contain procedures for pushing entries,popping entries,testing for an empty stack,and testing for a full stack.,程序员也可以将堆栈编写成一个可以进行进栈和出栈操作的抽象工具。注意,这些过程应该可以处理诸如试图从空栈中弹出数据,或者将数据压入一个已经填满的堆栈等特殊情况。所以一个完整的堆栈系统应该包括进栈、出栈、测试堆栈是否空或满的功能。,4.2 Stacks,计算机专业英语,4-14,New Words vt.使移居,使移植circular queue 循环队列envision vt.想象,预想bridge vt.跨接,接通,4.3 Queues,计算机专业英语,4-15,In contrast to a stack in which both insertions and deletions are performed at the same end,a queue is a list in which all insertions are performed at one end while all deletions are made at the other.We have already met this structure in relation to waiting lines,where we recognized it as being a first-in,first-out(FIFO)storage system.Actually,the concept of a queue is inherent in any system in which objects are served in the same order in which they arrive.,4.3 Queues,栈的插入与删除操作都是在表的相同端进行的。而与此不同,队列是插入和删除操作分别在两端进行的表。我们已经遇到过这种与等待队列相关的结构,在此种情况中,我们把它当作是一种先进先出的存储系统。实际上,在那些对象输入与输出顺序相同的系统中,队列的概念是与生俱来的。队列的结尾从等待队列的关联中得到名字。,计算机专业英语,4-16,Translation,1 Data structures are context-free because they can be used with any type of data and in a variety of situations or contexts.译文:因为数据结构能用于任何类型的数据,并用于多种环境中,所以数据结构与使用环境无关。本句中的“because”引导原因状语从句。2 General data structure types include the array,the stack,the queue,the tree and so on.译文:一般的数据结构类型包括数组、堆栈、队列、树等。本句中的“the array,the file,the record,the table,the tree,and so on”是宾语,其中包含若干项并列部分。,计算机专业英语,4-17,Reading Material Stacks and Queues,The end of a stack at which entries are inserted and deleted is called the top of the stack.The other end is sometimes called the stacks base.To reflect the fact that access to a stack is restricted to the topmost entry,we use special terminology when referring to the insertion and deletion operations.The process of inserting an object on the stack is called a push operation,and the process of deleting an object is called a pop operation.Thus we speak of pushing an entry onto a stack and popping an entry off a stack.,计算机专业英语,4-18,常用英汉互译技巧,一、增译法根据英汉两种语言不同的思维方式、语言习惯和表达方式,在翻译时增添一些词、短句或句子,以便更准确地表达出原文所包含的意义。这种方式多半用在汉译英里。1、汉语无主句较多,而英语句子一般都要有主语,所以在翻译汉语无主句的时候,除了少数可用英语无主句、被动语态或“There be”结构来翻译以外,一般都要根据语境补出主语,使句子完整。2、英汉两种语言在名词、代词、连词、介词和冠词的使用方法上也存在很大差别。英语中代词使用频率较高,凡说到人的器官和归某人所有的或与某人有关的事物时,必须在前面加上物主代词。因此,在汉译英时需要增补物主代词,而在英译汉时又需要根据情况适当地删减。3、英语词与词、词组与词组以及句子与句子的逻辑关系一般用连词来表示,而汉语则往往通过上下文和语序来表示这种关系。因此,在汉译英时常常需要增补连词。英语句子离不开介词和冠词。4、在汉译英时还要注意增补一些原文中暗含而没有明言的词语和一些概括性、注释性的词语,以确保译文意思的完整。,计算机专业英语,4-19,常用英汉互译技巧,一、增译法例1.Indeed,the reverse is true 实际情况恰好相反。(增译名词)例2.这是这两代计算机之间的又一个共同点。This is yet another common point between the computers of the two generations.(增译介词)例3.Individual mathematicians often have their own way of pronouncing mathematical expressions and in many cases there is no generally accepted“correct”pronunciation.每个数学家对数学公式常常有各自的读法,在许多情况下,并不存在一个普遍接受的所谓“正确”读法。(增加隐含意义的词)例4.只有在可能发生混淆、或要强调其观点时,数学家才使用较长的读法 It is only when confusion may occur,or where he/she wishes to emphasis the point,that the mathematician will use the longer forms.(增加主语),计算机专业英语,4-20,常用英汉互译技巧,二、省译法这是与增译法相对应的一种翻译方法,即删去不符合目标语思维习惯、语言习惯和表达方式的词,以避免译文累赘。增译法的例句反之即可。又如:例1.You will be staying in this hotel during your visit in Beijing.你在北京访问期间就住在这家饭店里。(省译物主代词)例2.I hope you will enjoy your stay here.希望您在这儿过得愉快。(省译主语)例3.中国政府历来重视环境保护工作。The Chinese government has always attached great importance to environmental protection.(省译名词)例4.The development of IC made it possible for electronic devices to become smaller and smaller.集成电路的发展是电子器件可以做得越来越小。(省译形式主语it),计算机专业英语,4-21,常用英汉互译技巧,三、转换法 在翻译过程中,为了使译文符合目标语的表述方式、方法和习惯,对原句中的词类、句型和语态等进行转换:1、在词性方面,把名词转换为代词、形容词、动词;把动词转换成名词、形容词、副词、介词;把形容词转换成副词和短语。2、在句子成分方面,把主语变成状语、定语、宾语、表语;把谓语变成主语、定语、表语;把定语变成状语、主语;把宾语变成主语。3、在句型方面,把并列句变成复合句,把复合句变成并列句,把状语从句变成定语从句。4、在语态方面,可以把主动语态变为被动语态。,计算机专业英语,4-22,常用英汉互译技巧,三、转换法 例1.Too much exposure to TV programs will do great harm to the eyesight of children.孩子们看电视过多会大大地损坏视力。(名词转动词)例2.由于我们实行了改革开放政策,我国的综合国力有了明显的增强。Thanks to the introduction of our reform and opening policy,our comprehensive national strength has greatly improved.(动词转名词)例3.时间不早了,我们回去吧!We dont have much time left.Lets go back.(句型转换),计算机专业英语,4-23,常用英汉互译技巧,四、拆句法和合并法 例1.Increased cooperation with China is in the interests of the United States.同中国加强合作,符合美国的利益。(在主谓连接处拆译)例3.中国是个大国,百分之八十的人口从事农业,但耕地只占土地面积的十分之一,其余为山脉、森林、城镇和其他用地。China is a large country with four-fifths of the population engaged in agriculture,but only one tenth of the land is farmland,the rest being mountains,forests and places for urban and other uses.(合译法)例4.Packet switching is a method of slicing digital messages into parcels called“packets,”sending the packets along different communication paths as they become available,and then reassembling the packets once they arrive at their destination.分组交换是传输数据的一种方法,它先将数据信息分割成许多称为“分组”的数据信息包;当路径可用时,经过不同的通信路径发送;当到达目的地后,再将它们组装起来。(将长定语从句拆成几个并列的分句),计算机专业英语,4-24,常用英汉互译技巧,五、正译法和反译法这两种方法通常用于汉译英,偶尔也用于英译汉。所谓正译,是指把句子按照与汉语相同的语序或表达方式译成英语。所谓反译则是指把句子按照与汉语相反的语序或表达方式译成英语。正译与反译常常具有同义的效果,但反译往往更符合英语的思维方式和表达习惯。因此比较地道。例1.你可以从因特网上获得这一信息。You can obtain this information on the Internet.(正译)This information is accessible/available on the Internet.(反译)例2.他突然想到了一个新主意。Suddenly he had a new idea.(正译)He suddenly thought out a new idea.(正译)A new idea suddenly occurred to/struck him.(反译),计算机专业英语,4-25,常用英汉互译技巧,六、倒置法在汉语中,定语修饰语和状语修饰语往往位于被修饰语之前;在英语中,许多修饰语常常位于被修饰语之后,因此翻译时往往要把原文的语序颠倒过来。倒置法通常用于英译汉,即对英语长句按照汉语的习惯表达法进行前后调换,按意群或进行全部倒置,原则是使汉语译句安排符合现代汉语论理叙事的一般逻辑顺序。有时倒置法也用于汉译英。如:例1.At this moment,through the wonder of telecommunications,more people are seeing and hearing what we say than on any other occasions in the whole history of the world.此时此刻,通过现代通信手段的奇迹,看到和听到我们讲话的人比整个世界历史上任何其他这样的场合都要多。(部分倒置)例2.改革开放以来,中国发生了巨大的变化。Great changes have taken place in China since the introduction of the reform and opening policy.(全部倒置),计算机专业英语,4-26,常用英汉互译技巧,七、包孕法 这种方法多用于英译汉。所谓包孕是指在把英语长句译成汉语时,把英语后置成分按照汉语的正常语序放在中心词之前,使修饰成分在汉语句中形成前置包孕。但修饰成分不宜过长,否则会形成拖沓或造成汉语句子成分在连接上的纠葛。如:例1.IP multicasting is a set of technologies that enables efficient delivery of data to many locations on a network.IP多信道广播是使数据向网络中许多位置高效传送的一组技术。例2.What brings us together is that we have common interests which transcend those differences.使我们走到一起的,是我们有超越这些分歧的共同利益,计算机专业英语,4-27,常用英汉互译技巧,八、插入法 指把难以处理的句子成分用破折号、括号或前后逗号插入译句中。这种方法主要用于笔译中。偶尔也用于口译中,即用同位语、插入语或定语从句来处理一些解释性成分。如:如果说宣布收回香港就会像夫人说的“带来灾难性的影响”,那我们将勇敢地面对这个灾难,做出决策。If the announcement of the recovery of Hong Kong would bring about,as Madam put it,“disastrous effects,”we will face that disaster squarely and make a new policy decision.,计算机专业英语,4-28,常用英汉互译技巧,九、重组法在进行英译汉时,为了使译文流畅和更符合汉语叙事论理的习惯,在捋清英语长句的结构、弄懂英语原意的基础上,彻底摆脱原文语序和句子形式,对句子进行重新组合。如:Decision must be made very rapidly;physical endurance is tested as much as perception,because an enormous amount of time must be spent making certain that the key figures act on the basis of the same information and purpose.必须把大量时间花在确保关键人物均根据同一情报和目的行事,而这一切对身体的耐力和思维能力都是一大考验。因此,一旦考虑成熟,决策者就应迅速做出决策。,计算机专业英语,4-29,常用英汉互译技巧,十、综合法指把难以处理的句子成分用破折号、括号或前后逗号插入译句中。这种方法主要用于笔译中。偶尔也用于口译中,即用同位语、插入语或定语从句来处理一些解释性成分。如:如果说宣布收回香港就会像夫人说的“带来灾难性的影响”,那我们将勇敢地面对这个灾难,做出决策。If the announcement of the recovery of Hong Kong would bring about,as Madam put it,“disastrous effects,”we will face that disaster squarely and make a new policy decision.,计算机专业英语,4-30,常用英汉互译技巧,十、综合法是指单用某种翻译技巧无法译出时,着眼篇章,以逻辑分析为基础,同时使用转换法、倒置法、增译法、省译法、拆句法等多种翻译技巧的方法。如:Behind this formal definition are three extremely important concepts that are the basis for understanding the Internet:packet switching,the TCP/IP communications protocol,and client/server computing.在这个正式的定义背后,隐含着三个极其重要的概念:分组交换、TCP/IP(传输控制协议/网际协议)通信协议和客户机/服务器计算技术,它们乃是理解因特网的基础。,