Quiz
Chapter 8
Este quiz tem tipos de pergunta que abrem no player de sempre.
Perguntas do quiz (30)
1Which of the following is a LIFO structure?
- AArray
- BStack
- CQueue
- DTree
2Which of the following is a FIFO structure?
- AArray
- BStack
- CQueue
- DTree
3Which of the following is an example of a tree structure?
- AWaiting line
- BStack of books
- CList of courses
- DOrganization chart
4Suppose 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?
- ATree
- BStack
- CQueue
- DTraditional linked list
5Suppose 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?
- AW
- BX
- CY
- DZ
6Suppose 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?
- AOne
- BTwo
- CThree
- DUndetermined
7If the two-dimensional array X was stored in row-major order, then in the block of main memory containing X, which of the following would be true?
- AThe entry X [1,2] would appear before X [2,1]
- BThe entry X [1,2] would appear after X [2,1]
- CThe entry X [1,2] would be in the same location as X [2,1]
- DNone of the above
8Which of the following is not used when determining the location of an entry in a two-dimensional array stored in row-major order?
- AIndices
- BNumber of rows in the array
- CAddress polynomial
- DNumber of columns in the array
9Which of the following is not a means of locating an entry in a linked storage structure?
- Ahead pointer
- Bchild pointer
- Croot pointer
- Dnull pointer
10If 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?
- Aw, x, r
- By, z, r
- Cr, y, z
- Dr, w, x
11If 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?
- Aw, x, r
- By, z, r
- Cr, y, z
- Dr, w, x
12If the number of nodes in a binary tree us 2^n (where n is a positive integer), then the entire tree would contain at least
- A2^n+1 nodes
- B2^2n nodes
- C2^n+1 - 1 nodes
- D2^n+2 nodes
13If 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?
- A4
- B7
- C15
- D31
14The nodes in which of the trees below will be printed in alphabetical order by the following recursive procedure?
def printTree (tree):
if (Tree is not None):
print(Tree.Value)
printTree(Tree.Right)
printTree(Tree.Left)
- AA
B C - BC
A B - CA
C B
- AA
15The nodes in which of the trees below will be printed in alphabetical order by the following recursive procedure?
def printTree (Tree):
if (Tree is not None):
printTree (Tree.Left)
printTree(Tree.Right)
print(Tree.Value)- AA
B C - BC
A B - CA
C B
- AA
16As dynamic data structures grow and shrink, storage space is used and released. The process of reclaiming unused storage space for future use is known as
- Amemory leak
- Baggregation
- Cgarbage collection
- Dabstraction
17Suppose 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?
- AThe number of nodes in the tree is always at least the number of nodes on the longest path in the tree
- BThe number of null pointers in the tree is always greater than the number of nodes in the tree
- CEach 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
- DBoth the left child and right child pointers of every terminal node are null
18If C++ language includes a collection of predefined classes for common data structures, such as stacks and queues. This collection is called the _________.
- ACommon Data Structure Library
- BCommon Interface Library
- CStandard Template Library
19A(n) ______ is a user-defined data type that can include both data and functions.
- Aad-hoc data type
- Bprogrammer type
- Cabstract data type
20In a machine language, the technique in which the data to be manipulated by an instruction is included within the instruction itself is called
- AImmediate addressing
- BDirect addressing
- CIndirect addressing
21In a machine language, the technique in which an instruction contains the location of a pointer to the data to be manipulated is called
- AImmediate addressing
- BDirect addressing
- CIndirect addressing
22Answer the following questions in terms of the tree below.
A
B C D
E F G
A. The root node is [blank_start]A[blank_end].
B. Three nodes that are siblings are [blank_start]B[blank_end], [blank_start]C[blank_end], and [blank_start]D[blank_end].
C. The terminal nodes are [blank_start]E, F, G, and D[blank_end].
D. The node with only one child is [blank_start]B[blank_end].- AA
- BB
- CC
- DD
- EE, F, G, and D
- FB
23Two special forms of lists are the LIFO structure known as a(n) [blank_start]Stack[blank_end], in which entries are inserted and removed from the [blank_start]Top[blank_end], and the FIFO structure known as a(n) [blank_start]Queue[blank_end], in which entries are removed from the [blank_start]Head[blank_end] and inserted at the [blank_start]Tail[blank_end].
- AStack
- BTop
- CQueue
- DHead
- ETail
24If a queue contained the entries B, C, D (from head to tail), what would be the contents of the queue (again from head to tail) after one entry was removed and the entry A was inserted?
[blank_start]C, D, A[blank_end]- AC, D, A
25Suppose a queue contained the entries A, B, C, D (from head to tail) and suppose that the entries were removed and pushed on a stack one at a time until the queue was empty. What would be the contents of the queue (again from head to tail) if the entries were then popped from the stack and inserted back in the queue one at a time:
[blank_start]D, C, B, A[blank_end]- AD, C, B, A
26The table below represents a portion of a computer's main memory containing a binary tree stored row by row in a contiguous block as described in the chapter.
What are the children of the node B?
Address Contents
50 A
51 B
52 C
53 D
54 E
55 F
56 G
[blank_start]D and E[blank_end]- AD and E
27If the longest path in a binary tree contains five nodes, what is the maximum number of terminal nodes that could be in the tree?
[blank_start]16[blank_end]- A16
28If the variable named Box had the user-defined type RectangleType defined by
struct RectangleType
{
float length;
float width;
float height
}
What expression would be used to reference the length of Box?
[blank_start]Struct RectangleType Box --> Box Length[blank_end]- AStruct RectangleType Box --> Box Length
29If the type BananaSplit was defined by a statement such as
struct BananaSplit
{
int Banana;
int IceCream;
int Chocolate;
int WhippedCream;
int Nuts;
int Cherry
}
What statement could be used to declare the variable Desert to be an instance of that type?
[blank_start]Struct BananaSplit Desert[blank_end]- AStruct BananaSplit Desert
30The following represents a portion of a computer's main memory.
Address Contents
50 51
51 56
52 53
53 57
54 58
55 50
56 57
57 52
58 53
A. What would be stored at address 50 after executing the instruction "Copy the contents of the memory cell at address 54 to address 50"? [blank_start]58[blank_end]
B. What would be stored at address 50 after executing the instruction "Copy the contents of the memory cell pointed to by the cell at address 54 to address 50"? [blank_start]53[blank_end]- A53
- B58
Informações
- Descrição
- Quiz sobre Chapter 8, criado por Charlene Manuel em 05-12-2022.
- Autor
- Charlene Manuel
- Idioma
- English
- Visualizações
- 0
- Avaliação
- Ainda sem avaliações Avalie este quiz