⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 5.txt

📁 icarnegie SSD5 Mutli-choice4-7
💻 TXT
📖 第 1 页 / 共 2 页
字号:
View Assessment Result: Multiple-Choice Quiz 5


 

 Your performance was as follows:  

 1. 
 Consider the following C++ program segment, which uses the STL. 

	
stack<int,vector<int> > S;

Execution of the statement results in creation of which of the following? 
 
 

  (a) A vector of integer stacks
 (b) A vector of integers
 (c) A stack of integers
 (d) A stack of integer vectors  

 Correct answer is  (c)  

 Your score on this question is: 0.00  

 Feedback: 
   See section 2.4.2 of the course notes.  
 

--------------------------------------------------------------------------------

 2. 
 Which of the following is a method (are methods) available in the class queue in the C++ Standard Template Library? 

push 
pop 
enqueue
 
 

  (a) None
 (b) I, II, and III
 (c) I and II only
 (d) III only  

 Correct answer is  (c)  

 Your score on this question is: 0.00  

 Feedback: 
   
See Chapter 7, page 249, in the course textbook. 
 
 

--------------------------------------------------------------------------------

 3. 
 In the C++ Standard Template Library (STL), the class queue is _____ that uses _____ for storage. 
 
 

  (a) an adapter, a C-style array
 (b) a sequence container, a C-style array
 (c) an adapter, a sequence container
 (d) a sequence container, an adapter class  

 Correct answer is  (c)  

 Your score on this question is: 0.00  

 Feedback: 
   
See Chapter 7, page 249, in the course textbook. 
 
 

--------------------------------------------------------------------------------

 4. 
 Which of the following is (are) typically managed using a stack? 

Implementation of function calls in a procedural programming language 
Evaluating arithmetic expressions, taking precedence rules into account 
Handling jobs sent to a printer, and ensuring that the first jobs to be submitted are printed first
 
 

  (a) I and II only
 (b) I and III only
 (c) I, II, and III
 (d) II only  

 Correct answer is  (a)  

 Your score on this question is: 0.00  

 Feedback: 
   
See Chapter 7, pages 235–236, in the course textbook. 
 
 

--------------------------------------------------------------------------------

 5. 
 Which of the following operations typically removes an item from a stack? 
 
 

  (a) top
 (b) pop
 (c) push
 (d) empty  

 Correct answer is  (b)  

 Your score on this question is: 10.00  

 Feedback: 
   
See Chapter 7, pages 233–234, in the course textbook. 
 
 

--------------------------------------------------------------------------------

 6. 
 Which of the following is not a basic operation that can be performed on a queue? 
 
 

  (a) Removing an item from the front of the queue
 (b) Inserting an item at the back of the queue
 (c) Accessing an item from the front of the queue
 (d) Inserting an item into the second position of the queue  

 Correct answer is  (d)  

 Your score on this question is: 0.00  

 Feedback: 
   
See Chapter 7, page 236, in the course textbook. 
 
 

--------------------------------------------------------------------------------

 7. 
 One thing that the STL vector and the STL list have in common is that both are  
 

  (a) based on arrays of elements
 (b) inherited from the superclass Container
 (c) random access containers
 (d) sequential containers  

 Correct answer is  (d)  

 Your score on this question is: 0.00  

 Feedback: 
   See section 2.2.2 of the course notes.  
 

--------------------------------------------------------------------------------

 8. 
 In the C++ standard template library (STL), which of the following is a property of const iterators for the list container?
 
 

  (a) Const iterators can be incremented, but never decremented.
 (b) They cannot be used to traverse a linked list.
 (c) They provide write-only access to a linked list.
 (d) They provide read-only access to a linked list.  

 Correct answer is  (d)  

 Your score on this question is: 0.00  

 Feedback: 
   See section 2.2.3 of the course notes.  
 

--------------------------------------------------------------------------------

 9. 
 Which of the following statements is (are) true about the locations of a linked list's nodes in memory?

Nodes must appear at a fixed distance from one another in memory. 
The order of elements in a list must match the order of the list's nodes in memory. 
 
 

  (a) None
 (b) I and II
 (c) II only
 (d) I only  

 Correct answer is  (a)  

 Your score on this question is: 0.00  

 Feedback: 
   
See section 2.3.1, subsection "A Non-Contiguous List," in the course notes.
 
 

--------------------------------------------------------------------------------

 10. 
 The nodes of a _____ linked list can be traversed _____.
 
 

  (a) singly, forward only
 (b) singly, forward and backward
 (c) doubly, forward only
 (d) doubly, backward only  

 Correct answer is  (a)  

 Your score on this question is: 0.00  

 Feedback: 
   
See section 2.3.1, subsection "Linking Elements Together," in the course notes.
 
 

--------------------------------------------------------------------------------

 Go to top of assessment.  

 Total score: 10.00 

 ? Copyright 2004 iCarnegie, Inc. All rights reserved.  
View Assessment Result: Multiple-Choice Quiz 5


 

 Your performance was as follows:  

 1. 
 Consider the following C++ program segment, which uses the STL. 

	
stack<int> S;
S.push(123);
S.push(456);
cout << S.pop() << endl;

Which of the following accurately describes what, if anything, fails in the segment? 
 
 

  (a) An execution error occurs because pop is a private member function.
 (b) An execution error occurs because an STL stack has no member function pop.
 (c) A compilation error occurs because pop does not return a value.
 (d) Nothing is wrong with the segment.  

 Correct answer is  (c)  

 Your score on this question is: 0.00  

 Feedback: 
   See section 2.4.2 of the course notes.  
 

--------------------------------------------------------------------------------

 2. 
 In the C++ Standard Template Library (STL), the class queue is _____ that uses _____ for storage. 
 
 

  (a) an adapter, a C-style array
 (b) a sequence container, a C-style array
 (c) a sequence container, an adapter class
 (d) an adapter, a sequence container  

 Correct answer is  (d)  

 Your score on this question is: 10.00  

 Feedback: 
   
See Chapter 7, page 249, in the course textbook. 
 
 

--------------------------------------------------------------------------------

 3. 
 Differences between the STL adapter queue and the STL container deque include which of the following?

queue provides support for iterators, whereas deque does not. 
queue provides access to only the first and last elements in a collection, whereas deque permits access to an entire collection. 
 
 

  (a) None
 (b) I only
 (c) II only
 (d) I and II  

 Correct answer is  (c)  

 Your score on this question is: 0.00  

 Feedback: 
   
See section 2.4.2 in the course notes.
 
 

--------------------------------------------------------------------------------

 4. 
 Which of the following is (are) typically managed using a stack? 

Implementation of function calls in a procedural programming language 
Evaluating arithmetic expressions, taking precedence rules into account 
Handling jobs sent to a printer, and ensuring that the first jobs to be submitted are printed first
 
 

  (a) I and II only
 (b) II only
 (c) I, II, and III
 (d) I and III only  

 Correct answer is  (a)  

 Your score on this question is: 10.00  

 Feedback: 
   
See Chapter 7, pages 235–236, in the course textbook. 
 
 

--------------------------------------------------------------------------------

 5. 
 Which of the following operations typically removes an item from a stack? 
 
 

  (a) pop
 (b) top
 (c) empty
 (d) push  

 Correct answer is  (a)  

 Your score on this question is: 10.00  

 Feedback: 
   
See Chapter 7, pages 233–234, in the course textbook. 
 
 

--------------------------------------------------------------------------------

 6. 
 Consider the following sequence of operations applied to an empty queue:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -