Filters
Question type

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 X[1,2] would appear before X[2,1].
B) The entry X[1,2] would appear after X[2,1].
C) The entry X[1,2] would be in the same location as X[2,1].
D) None of the above

E) A) and C)
F) A) and B)

Correct Answer

verifed

verified

What is the distinction between direct addressing and indirect addressing?

Correct Answer

verifed

verified

When using direct addressing,the address...

View Answer

Suppose 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.

Correct Answer

verifed

verified

The table below represents a portion of a computer's main memory containing a linked list.Each entry consists of two cells,the first being data,the second being a pointer to the next entry.If the null pointer is represented by 00 and the list's head pointer contains 52,modify the memory cells so the data at address 50 replaces the second entry in the list.  Address  Content 50AA510052BB535854CC550056DD570058EE5954\begin{array} { c c } \text { Address } & \text { Content } \\50 & \mathrm { AA } \\51 & 00 \\52 & \mathrm { BB } \\53 & 58 \\54 & \mathrm { CC } \\55 & 00 \\56 & \mathrm { DD } \\57 & 00 \\58 & \mathrm { EE } \\59 & 54\end{array}

Correct Answer

verifed

verified

Change the cell at a...

View Answer

The 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)


A) The 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)  A)    B)    C)
B) The 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)  A)    B)    C)
C) The 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)  A)    B)    C)

D) None of the above
E) All of the above

Correct Answer

verifed

verified

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) Tree
B) Stack
C) Queue
D) Traditional linked list

E) B) and C)
F) C) and D)

Correct Answer

verifed

verified

What sequence of nodes from the tree What sequence of nodes from the tree     would be printed if the following recursive procedure were applied to it? (The procedure uses a global stack called Stack that is assumed to begin empty.) def printTree(Tree): if (Tree is not None): Stack.push(Tree.Value) printTree(Tree.Right) if (not Stack.isEmpty()): print(Stack.pop()) would be printed if the following recursive procedure were applied to it? (The procedure uses a global stack called Stack that is assumed to begin empty.) def printTree(Tree): if (Tree is not None): Stack.push(Tree.Value) printTree(Tree.Right) if (not Stack.isEmpty()): print(Stack.pop())

Correct Answer

verifed

verified

G,C,A

In a machine language,what advantage does indirect addressing offer over immediate and direct addressing?

Correct Answer

verifed

verified

Indirect addressing allows the...

View Answer

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) W
B) X
C) Y
D) Z

E) None of the above
F) All of the above

Correct Answer

verifed

verified

Answer the following questions in terms of the tree below. Answer the following questions in terms of the tree below.     A. The root node is ________ . B. Three nodes that are siblings are _______ , ________, and ________ . C. The terminal nodes are _________________________________________ . D. The node with only one child is _________ . A. The root node is ________ . B. Three nodes that are siblings are _______ , ________, and ________ . C. The terminal nodes are _________________________________________ . D. The node with only one child is _________ .

Correct Answer

verifed

verified

A.A
B.B,C...

View Answer

In a machine language,the technique in which the data to be manipulated by an instruction is included within the instruction itself is called


A) Immediate addressing
B) Direct addressing
C) Indirect addressing

D) B) and C)
E) All of the above

Correct Answer

verifed

verified

A

If 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 would probably be used to declare the variable Desert to be an instance of that type?

Correct Answer

verifed

verified

struct BananaSplit Desert;
(Th...

View Answer

If the number of nodes in a binary tree is 2ⁿ (where n is a positive integer) ,then the entire tree would contain at least


A) 2ⁿ ⁺ ¹ nodes
B) 2²ⁿ nodes
C) 2ⁿ ⁺ ¹ - 1 nodes
D) 2ⁿ ⁺ ² nodes

E) C) and D)
F) B) and D)

Correct Answer

verifed

verified

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, r
B) y, z, r
C) r, y, z
D) r, w, x

E) A) and B)
F) B) and D)

Correct Answer

verifed

verified

If the longest path in a binary tree contains five nodes,what is the maximum number of terminal nodes that could be in the tree?

Correct Answer

verifed

verified

The table below represents a portion of a computer's main memory containing a binary tree.Each node consists of three cells,the first being data,the second being a pointer to the node's left child,and the third being a pointer to the node's right child.If the null pointer is represented by 00 and the tree's root pointer contains 53,how many nodes are on the longest path in the tree?  Address  Contents 50 AA 5156520053BB5400555056CC57005800\begin{array} { c c } \text { Address } & \text { Contents } \\50 & \text { AA } \\51 & 56 \\52 & 00 \\53 & \mathrm { BB } \\54 & 00 \\55 & 50 \\56 & \mathrm { CC } \\57 & 00 \\58 & 00\end{array}

Correct Answer

verifed

verified

The table below represents a portion of a computer's main memory containing a binary tree.Each node consists of three cells,the first being data,the second being a pointer to the node's left child,and the third being a pointer to the node's right child.If the null pointer is represented by 00 and the tree's root pointer contains 50,which of the following is a picture of the tree?  Address  Conten 50 A5156525353 B5400550056C57005800\begin{array} { c c } \text { Address } & \text { Conten } \\50 & \mathrm {~A} \\51 & 56 \\52 & 53 \\53 & \mathrm {~B} \\54 & 00 \\55 & 00 \\56 & \mathrm { C } \\57 & 00 \\58 & 00\end{array}


A)  The table below represents a portion of a computer's main memory containing a binary tree.Each node consists of three cells,the first being data,the second being a pointer to the node's left child,and the third being a pointer to the node's right child.If the null pointer is represented by 00 and the tree's root pointer contains 50,which of the following is a picture of the tree?  \begin{array} { c c }  \text { Address } & \text { Conten } \\ 50 & \mathrm {~A} \\ 51 & 56 \\ 52 & 53 \\ 53 & \mathrm {~B} \\ 54 & 00 \\ 55 & 00 \\ 56 & \mathrm { C } \\ 57 & 00 \\ 58 & 00 \end{array}  A)    B)    C)
B)  The table below represents a portion of a computer's main memory containing a binary tree.Each node consists of three cells,the first being data,the second being a pointer to the node's left child,and the third being a pointer to the node's right child.If the null pointer is represented by 00 and the tree's root pointer contains 50,which of the following is a picture of the tree?  \begin{array} { c c }  \text { Address } & \text { Conten } \\ 50 & \mathrm {~A} \\ 51 & 56 \\ 52 & 53 \\ 53 & \mathrm {~B} \\ 54 & 00 \\ 55 & 00 \\ 56 & \mathrm { C } \\ 57 & 00 \\ 58 & 00 \end{array}  A)    B)    C)
C)  The table below represents a portion of a computer's main memory containing a binary tree.Each node consists of three cells,the first being data,the second being a pointer to the node's left child,and the third being a pointer to the node's right child.If the null pointer is represented by 00 and the tree's root pointer contains 50,which of the following is a picture of the tree?  \begin{array} { c c }  \text { Address } & \text { Conten } \\ 50 & \mathrm {~A} \\ 51 & 56 \\ 52 & 53 \\ 53 & \mathrm {~B} \\ 54 & 00 \\ 55 & 00 \\ 56 & \mathrm { C } \\ 57 & 00 \\ 58 & 00 \end{array}  A)    B)    C)

D) All of the above
E) A) and C)

Correct Answer

verifed

verified

Two special forms of lists are the LIFO structures known as _______________ ,in which entries are inserted and removed from the ______________ ,and FIFO structures known as ________________ , in which entries are removed from the ________________ and inserted at the ________________ .

Correct Answer

verifed

verified

stacks,top...

View Answer

Which of the following is not used when determining the location of an entry in a two-dimensional array stored in row-major order?


A) Indices
B) Number of rows in the array
C) Address polynomial
D) Number of columns in the array

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

B

If 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?

Correct Answer

verifed

verified

Showing 1 - 20 of 53

Related Exams

Show Answer