Sie sind auf Seite 1von 19

7.

If the two -dimensional array X were stored in row-major


orde r, then in the block of main memory
c onta ining X, which of the following would be true?
A. The e ntry X [ 1,2] wou ld a ppea r be fore X[ 2,1] .
B . T he e n tr y X [ 1, 2] wo u ld a pp e a r a fte r X [ 2 ,1 ] .
C . Th e e nt ry X [ 1 ,2 ] w ou l d b e in th e s a me l o ca ti on a s X [ 2, 1]
.
D. None of the above
A N S W E R:
A
8. W hich of the following is not use d when dete rmining the l
oca tion of an e ntry in a two -dimensiona l
h o m o g e n e o u s a rr a y s t o re d i n ro w - m a j o r o rd e r ?
A. I n d i c e s
B. Number of rows in the array
C . Addre ss polynomial
D. Number of columns in the array
A N S W E R:
B
9. W hich of the following is not a means of loca ting an entry
in a linke d stora ge structure ?
A. Head pointer
B. Child pointer
C . Ro o t p o i n t e r

D
. NIL pointer
A N S W E R:
D
10. If a stack conta ined the entrie s
w
,
x
,
y
,
z
( f rom top to bot tom) , which of the fo ll owing would be the
c onte nts a fte r two e ntrie s we re re m ove d a nd the e ntry
r
was inserted?
A.
w
,
x
,
r
B.
y
,
z
,
r
C.
r
,
y
,
z
D.
r

,
w
,
x
A N S W E R:
C
1 1 . I f a qu e u e co nt a i ne d t he e nt ri e s
w
,
x
,
y
,
z
(from hea d to tail), which of the following would be the
c on te nt s a fte r tw o e nt ri e s w e re re m o ve d a n d t he e nt ry
r
was inserted?
A.
w
,
x
,
r
B.
y
,
z
,
r
C.
r
,
y
,
z

D.
r
,
w
,
x
A N S W E R:
B
12. If the number of nodes in a binary tree is 2
n
(where
n
is a positive inte ge r) , the n the entire tree
would contain at least
A. 2
n
+1
nodes
B
. 2
2
n
nodes
C. 2
n
+1
- 1 nodes
D. 2
n
+2
nodes
A N S W E R:
C

13. 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. 4
B. 7
C. 15
D. 31
A N S W E R:
C
14. The node s in which of the trees below will be printe d in
a lphabetical orde r 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.

A N S W E R:
C
15. The nodes in which of the trees below will be printed in a
lphabetical 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.

A N S W E R:
B
16. The table below represents a portion of a compute rs ma
in memory containing a binary tree. Each
node consists of three cells, the fi rst being data, the second
being a pointe
r to the nodes left child, and
the third being a pointer to the nodes right child. If the nil p
ointer is represented by 00 and the trees
root pointer contains 50, which of the following is a picture of
the tree?

Address

Contents

50

51

56

52

53

53

54

00

55

00

56

57

00

58

00
A.

B.
C.

A N S W E R:
C
17. Suppose a binary tree is implemented as a linked structur
e in which each node contains both a left
c hild pointe r and a right child pointe r. W hich of the followin
g sta te me nts is fa lse?

A. The numbe r of nodes in the tree is always at least the nu


m be r of nodes on the longes t path in
the tree.
B. The number of NIL pointers in the tree is always greater t
han the number of nodes in the
tree.
C. Each terminal node in the tree is always at the end of a p
ath that is as least as long as any
othe r pa th in the tre e .
D. Both the left child and right child pointers of every termina
l node are NIL.
A N S W E R:
C
18. The table below represents a portion of a compute rs ma
in 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

51

52

53

54

55

56

A. W
B. X
C. Y
D. Z
A N S W E R:
C
19. The table below represents a portion of a compute rs ma
in memory containing a binary tree stored
row by ro w in a cont iguous bl ock as des cri be d in the cha pte
r. W ha t is the pa re nt of the node Z?
Address

Contents

50

51

52

53

54

55

56

A.

B. U
C. V
D. Y
A N S W E R:
C
20. 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. I m m e d i a t e a d d re s s i n g
B. Direct addressing

C. Indirect addressing
A N S W E R:
A
21. In a machine language, the technique in which an instruc
tion contains the location of a pointer to
the da ta to be manipula te d is ca lled
A. I m m e d i a t e a d d re s s i n g
B. Direct addressing
C. Indirect addressing
A N S W E R:
C

Das könnte Ihnen auch gefallen