计算机科学导论原书第二版答案第十二章.pdfVIP

  • 8
  • 0
  • 约2.31万字
  • 约 14页
  • 2020-02-12 发布于江苏
  • 举报

计算机科学导论原书第二版答案第十二章.pdf

CHAPTER 12 Abstract Data Types (Solutions to Practice Set) Review Questions 1. An abstract data type (ADT) is a data declaration packaged together with the oper- ations that are meaningful for the data type. In an ADT, the operations used to access the data are known, but the implementation of the operations are hidden. 2. A stack is a restricted linear list in which all additions and deletions are made at one end, called the top. If we insert a series of data into a stack and then remove it, the order of the data will be reversed. This reversing attribute is why stacks are known as a last in, first out (LIFO) data structure. Four basic stack operations defined in this chapter are stack, push , pop , and empty. 3. A queue is a linear list in which data can only be inserted at one end, called the rear, and deleted from the other end, called the front. These restrictions ensure that the data are processed through the queue in the order in which they are received. In other words, a queue is a first in, first out (FIFO) structure. Four basic queue oper- ations defined in this chapter are queue, enqueue, dequeue, and empty. 4. A general linear list is a list in which operations, such as insertion, can be done anywhere in the list, that is, at the beginning, in the middle, or at the end of the list. Six common general linear list operations defined in this chapter are list, insert, delete, retrieve, traverse, and empty. 5. A tree consists of a finite set of elements, called nodes (or

文档评论(0)

1亿VIP精品文档

相关文档