Test08(选择题)_第1页
Test08(选择题)_第2页
Test08(选择题)_第3页
Test08(选择题)_第4页
Test08(选择题)_第5页
已阅读5页,还剩1页未读 继续免费阅读

下载本文档

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

文档简介

Test BankChapter Eight (Data Abstractions)Multiple Choice Questions1. Which of the following is a LIFO structure?A. ArrayB. StackC. QueueD. TreeANSWER: B2. Which of the following is a FIFO structure?A. ArrayB. StackC. QueueD. TreeANSWER: C3. Which of the following is static in the sense that it does not change size or shape as information is stored and retrieved?A. ArrayB. StackC. QueueD. TreeANSWER: A4. Suppose you were going to retrieve items of data that you would later need to process in the opposite order from that in which they were retrieved. Which of the following would be the best structure in which to store the items?A. Traditional linked listB. StackC. QueueD. TreeANSWER: B5. Suppose a binary tree contained the nodes W, X, Y, and Z. If W and X were children of Y, and Z had no children, which node would be the root?A. WB. XC. YD. ZANSWER: C6. Suppose a binary tree contained the nodes W, X, Y, and Z, and each node had at most one child. How many terminal nodes would be in the tree?A. OneB. TwoC. ThreeD. UndeterminedANSWER: A7. If the two-dimensional array X were stored in row-major order, then in the block of main memory containing X, which of the following would be true?A. The entry X1,2 would appear before X2,1.B. The entry X1,2 would appear after X2,1.C. The entry X1,2 would be in the same location as X2,1.D. None of the aboveANSWER: A8. Which of the following is not used when determining the location of an entry in a two-dimensional homogeneous array stored in row-major order?A. IndicesB. Number of rows in the arrayC. Address polynomialD. Number of columns in the arrayANSWER: B9. Which of the following is not a means of locating an entry in a linked storage structure?A. Head pointerB. Child pointerC. Root pointerD. NIL pointerANSWER: D10. If a stack contained the entries w, x, y, z (from top to bottom), which of the following would be the contents after two entries were removed and the entry r was inserted?A. w, x, rB. y, z, rC. r, y, zD. r, w, xANSWER: C11. If a queue contained the entries w, x, y, z (from head to tail), which of the following would be the contents after two entries were removed and the entry r was inserted?A. w, x, rB. y, z, rC. r, y, zD. r, w, xANSWER: B12. If the number of nodes in a binary tree is 2n (where n is a positive integer), then the entire tree would contain at leastA. 2n + 1 nodesB. 22n nodesC. 2n + 1 - 1 nodesD. 2n + 2 nodesANSWER: C13. If the longest path in a binary tree contained exactly four nodes, what is the maximum number of nodes that could be in the entire tree?A. 4B. 7C. 15D. 31ANSWER: C14. The nodes in which of the trees below will be printed in alphabetical order by the following recursive procedure?procedure printTree (Tree)if (Tree is not empty) then (print the root node; apply the procedure printTree to the right subtree of Tree; apply the procedure printTree to the left subtree of Tree)A. B.C. ANSWER: C15. The nodes in which of the trees below will be printed in alphabetical order by the following recursive procedure?procedure printTree (Tree)if (Tree is not empty) then (apply the procedure printTree to the left subtree of Tree; apply the procedure printTree to the right subtree of Tree; print the root node)A. B.C. ANSWER: B16. The table below represents a portion of a computers main memory containing a binary tree. Each node consists of three cells, the first being data, the second being a pointer to the nodes left child, and the third being a pointer to the nodes right child. If the nil pointer is represented by 00 and the trees root pointer contains 50, which of the following is a picture of the tree?Address Contents 50 A 51 56 52 53 53 B 54 00 55 00 56 C 57 00 58 00A. B.C. ANSWER: C17. Suppose a binary tree is implemented as a linked structure in which each node contains both a left child pointer and a right child pointer. Which of the following statements is false?A. The number of nodes in the tree is always at least the number of nodes on the longest path in the tree.B. The number of NIL pointers in the tree is always greater than the number of nodes in the tree.C. Each terminal node in the tree is always at the end of a path that is as least as long as any other path in the tree.D. Both the left child and right child pointers of every terminal node are NIL.ANSWER: C 18. The table below represents a portion of a computers main memory containing a binary tree stored row by row in a contiguous block as described in the chapter. What is the left child of the node V?Address Contents 50 T 51 U 52 V 53 W 54 X 55 Y 56 Z A. WB. XC. YD. ZANSWER: C19. The table below represents a portion of a computers main memory containing a binary tree stored row by row in a contiguous block as described in the chapter. What is the parent of the node Z?Address Contents 50 T 51 U 52 V 53 W 54 X 55 Y 56 Z A. TB. UC. VD. YANSWER: C20. In a machine language, the technique in which the data to be manipulated by an instruction is included within the instruction itself is calledA. Immediate addressing

温馨提示

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

评论

0/150

提交评论