《计算机专业英语》电子教案-第4章_第1页
《计算机专业英语》电子教案-第4章_第2页
《计算机专业英语》电子教案-第4章_第3页
《计算机专业英语》电子教案-第4章_第4页
《计算机专业英语》电子教案-第4章_第5页
已阅读5页,还剩38页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Computer English,chapter 4 data structure,计算机专业英语,4-2,key points 3360 useful terms and definitions of data structure difficationsthree reasons for using data structures are efficiency,abstraction,and reusability。2 .the properties of stack,queue,and tree,3 .英汉互译技术、计算机专业英语、4-4、New Words thus、They offe

2、r a level of abstraction in solving problems . for example、by storing datain other words,Data structures let us talk about programs in a less programmatic way。抽象数据结构提供了更好地理解数据的方法。因此,为问题解决提供了一定程度的抽象。例如,通过将数据存储在堆栈中,可以将重点放在堆栈操作上,例如,移动到堆栈和堆栈外,而不是移动到实现操作的详细信息上。也就是说,通过数据结构,可以用更少的编程方式谈论程序。4.1 an introducti

3、on to data structures,计算机专业英语,4-8,Reusability data structures are reusable because they tend to be modular andthat is,Web access the data using only those operations the interface defines . data structures are context-free because they can be used with anany重用:由于数据结构趋向模块化,与环境无关,因此可以重用数据结构。因为每个结构都有一个

4、预定的界面,限制了对存储在数据结构中的数据的访问,所以是模块化的。也就是说,只有界面定义的那些操作才能访问数据。数据结构与使用环境无关,因为数据结构可用于所有类型的数据,并可用于各种环境。c语言使用空指针,而不是通过维护未公开的数据备份来确保所有类型的数据都存储在数据结构中。4.1 an introduction to data structures,计算机专业英语,4-9,new words yet later,when the procedure is completed,The machine munualthis means that,when the initial transfer

5、 is made,There must be a mechanism for remembering the location to which execution ultimately retection回溯堆栈的典型应用程序发生在一个程序单元调用一个进程的操作中。要完成这个调用,机器必须把注意力转向那个过程;过程调用结束后,系统必须返回到调用程序块的位置。也就是说,必须有记录操作结束后返回位置的机制。4.2 Stacks,计算机专业英语,4-13,the situation is complicated by the fact that the procedure may itself r

6、equest the execution of another PPSconequence,the return locations being remembered begin to pile up . later,As each of these procedures is completed,Execution must bea system is therefore need to save the r Etern locations and later retrieve them in the proper order .如果调用的过程本身调用了其他过程,该过程也需要调用其他过程,则

7、整个方案变得复杂。所以返回地址的记忆开始堆积起来。然后,在每个进程结束时,操作必须返回到程序块(称为完成进程)中的相应位置。因此,系统必须按照适当的顺序存储和回收返回地址。,4.2 Stacks,计算机专业英语,4-14,A stack is an ideal structure for such A system . as each procedure is called,A pointer to the pertinentthis example is re presentative of s Tack applications in general in that it demonstr

8、ates the relationship between stacks and the process of back tracksindeed,The concept of a stack is inherent in any process that entails backing out of a system in The opposite order from which it was entered .堆栈是满足这些需求的理想结构。调用进程时,返回地址的指针进入堆栈。然后,在过程完成时将堆栈顶部的项目导出到堆栈中,程序就可以正确地获取返回地址。这是应用堆栈的典型示例,显示了堆栈与

9、回溯进程的关系。在从入门级反向返回系统的所有过程中,堆栈的概念是固有的。4.2 Stacks,计算机专业英语,4-15,as another example of back tracking,suppose web want to print the names in a linked list in reverse Oraclethus we need a way of holding each Nam E retrieved until all of the names that follow have been retrieved and printed .our solution is

10、 to traverse the list from its beginning to its end whil pushin the names we find onto a stack .after reaching the end of the list,we print the names as web pop them off the stack。让我们再举一个例子,假设链接表的名称反向输出,即最后一个名称的第一个输出。问题是,我们只能沿着链接结构访问名称。因此,需要一种方法来搜索每个名称,直到在此名称后出现并输出数组的名称。我们的计划是从连接的列表的开始顺序到结束,依次将每个名称移

11、动到堆栈。到达连接列表的末尾时,通过堆栈操作输出名称。4.2 Stacks,计算机专业英语,4-16,stack implementation to implement a stack structure in a computers memory,It is customary to reserve(determining the size of This block can often be a critical decision。if too little room is reserved,the stack ultimately exceds the alloted storage s

12、pace;If too much room is reserved,Memory space will be wated。)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 tows堆栈的实现是为了在计算机存储中实现堆栈结构,通常保留足够的内存单元以

13、适应堆栈大小的更改。(通常,确定块的大小是非常重要的任务。保留空间太小可能会导致堆栈在分配的存储空间中溢出。保留的空间太大是浪费。)块的一端作为堆栈的底部,堆栈中的第一个数据存储在此处,后续条目依次放置在其后的存储单元中。也就是说,堆栈增加到另一端。4.2 Stacks,计算机专业英语,4-17,thus,as entries are pushed and popped,The top of The stack moves back and forth within The reservera means is therefore need to maintain a record Of the location Of the top entry .for this purpose,the address of the top entry is stored in an additional memory cell known as the stack pointer。that is,The stack pointer points to The top of The stack。因此,当项目进入堆栈并退出堆栈时,堆栈顶部的位置在存储单元块中前后移动。为了存储此位置的轨道,堆栈顶部条目的地址存储在称为堆栈指针的附加存储设备上。也就是说,堆栈指针是指向堆栈顶部的指针。4.2

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论