Need Answers ASAP. Thanks! Question 1 One of the ways an abstract data type can be implemented in C++ is by using a(n) _____. array
Need Answers ASAP. Thanks!
Question 1
One of the ways an abstract data type can be implemented in C++ is by using a(n) _____.
Question 2
(TCO 1) These operations are present in most of the ADTs: _____.
| inorder traversal, postorder traversal |
| sort, remover all, find duplicates |
Question 3
(TCO 1) Which behavior is not represented in a bag?
| Report the number of items in the bag. |
| Report if the bag is empty. |
Question 4
(TCO 1) When deleting an entry from an array-based implementation of the ADT list at the end of the list _____.
| all of the previous elements must be shifted toward the front of the array |
| only one element is shifted toward the end of the array to close the gap |
| only one element is shifted toward the beginning of the array to close the gap |
Question 5
(TCO 2) In the node object of a linked list, the next field contains _____.
| the data portion of the node |
| a pointer to the beginning of the list |
| a pointer to another node |
Question 6
(TCO 2) _____ can be traversed backward.
Question 7
(TCO 2) In a doubly linked list, the running time of accessing the first node is _____.
Question 8
(TCO 2) Including a tail pointer to a linked implementation of a list makes which functionality more efficient?
| Adding a node to the end of a list |
| Searching for a node on the list |
| Removing a node from the list |
Question 9
(TCO 3) If the numbers 9, 17, 21, 34 are inserted, in that order, in a stack, which will be the first element to be removed?
Question 10
(TCO 3) What is the stack operation implemented in the following function? The variable top represents the stack top. int operation() { return list[top-1]; }
Question 11
(TCO 3) Consider the following program fragment. Stack s; s.push(1); s.push(2); s.push(3); s.push(4); cout << s.peek() << endl; What is the value displayed by the cout statement?
Question 12
(TCO 3) A queue can be implemented using a(n) _____.
Question 13
(TCO 4) Which of the following functions has a constant growth rate?
Question 14
(TCO 4) Algorithms can be described using _____.
| assignment and arithmetic operations |
| loops and decision statements |
Question 15
(TCO 4) The running time of an algorithm is _____.
| the time, in milliseconds, it takes to complete its execution |
| the running time of its implementation |
| the maximum number of basic operations executed by the algorithm (over all inputs of size N) |
| the number of steps given in its description |
Question 16
(TCO 4) The running time of an algorithm to find the maximum of a collection of n numbers stored in an array is _____.
Question 17
(TCO 5) Which of the following is a search algorithm or technique?
Question 18
(TCO 5) In a binary search, the main loop executes, approximately, _____. (Note: Below, n is the number of elements in the array.)
Question 19
(TCO 5) There are two basic types of hashing, _____.
| linear probing and random probing |
| open addressing and separate chaining |
Question 20
(TCO 5) In separate chaining, the keys that map to the same hash value are stored in a(n) _____.