A+_Sample_Review
A+_Sample_Review
com
www.apluscompsci.com
© A+ Computer Science - www.apluscompsci.com
© A+ Computer Science - www.apluscompsci.com
<*1> x = 89;
I. int
II. byte
III. short
IV. long
V. double
2. Which of the following could fill <*1> without causing a compile error?
<*1> x = 160;
I. int
II. byte
III. short
IV. long
V. double
3. Which of the following could fill <*1> without causing a compile error?
<*1> x = 32799;
I. int
II. byte
III. short
IV. long
V. double
a. 221
b. 201
c. 3
d. 100
e. 101
a. 221
b. 201
c. 3
d. 100
e. 101
a. 221
b. 201
c. 3
d. 100
e. 101
17. If a search value exists in a sorted list of 3000 items, what is the maximum number of comparisons that may be
needed to find the search value using a binary search?
a. 11
b. 8
c. 12
d. 10
e. 9
18. If a search value exists in a sorted list of 1000 items, what is the maximum number of comparisons that may be
needed to find the search value using a binary search?
a. 11
b. 8
c. 12
d. 10
e. 9
19. How many times will method go() be called given the call check( 10 ) ?
a. 100
b. 55
c. 45
d. 90
e. 54
c <- 30
repeat until c < 10
c <- c - 5
display c
A. 30
B. 20
C. 10
D. 5
E. 0
c <- 0
repeat until ( c > 15 )
{
c <- c + 4
}
display( c )
A. 18
B. 20
C. 12
D. 16
E. 0
c <- 0
repeat until ( c > 10 )
c <- c + 3
display c
A. 12
B. 9
C. 10
D. 6
E. 0
procedure go( x )
{
if( x mod 2 == 0 )
return 1
return 2
}
display( go( 8 ) )
A. 0
B. 1
C. 2
D. 3
E. 4
procedure go( x )
{
if( x > 5 )
return 1
if( x > 2 )
return 2
return 3
}
display( go( 8 ) )
A. 0
B. 1
C. 2
D. 3
E. 4
a. binary tree
b. max-heap
c. binary search tree
d. min-heap
e. stack
2. Give the tree shown below, which of the following data structures best describes the tree?
10
3 18
2 1 15 14
0 -2
a. binary tree
b. max-heap
c. binary search tree
d. min-heap
e. stack
3. Give the tree shown below, which of the following data structures best describes the tree?
15
3 8
1 2 7 6
0 -2
a. binary tree
b. max-heap
c. binary search tree
d. min-heap
e. stack
www.apluscompsci.com
© A+ Computer Science - www.apluscompsci.com