Saturday, October 27, 2007

Selection Sort Interview Question Part 3


27. What is the output of selection sort for the following numbers after the 8th pass?
3 6 9 2 7 10 1 5 8 4
a. 1 2 3 4 5 6 10 9 8 7
b. 1 2 3 4 5 6 7 9 8 10
c.1 2 3 4 5 6 7 8 9 10
d. 1 2 3 4 7 10 9 6 8 5
Ans:c

28. What is the output of selection sort for the following numbers after the 9th pass?
3 6 9 2 7 10 1 5 8 4
a. 1 2 3 4 5 6 10 9 8 7
b. 1 2 3 4 5 6 7 9 8 10
c.1 2 3 4 5 6 7 8 9 10
d. 1 2 3 4 7 10 9 6 8 5
Ans:c


29. What is the output of selection sort after the 1st pass given the following sequence of numbers: 7 3 5 1 9 8 4 6
a. 1 7 5 3 9 8 4 6
b. 1 3 7 5 9 8 4 6
c. 1 3 4 7 9 8 5 6
d. 1 3 4 5 9 8 7 6
Ans:a

30. What is the output of selection sort after the 2nd pass given the following sequence of numbers: 7 3 5 1 9 8 4 6
a. 1 7 5 3 9 8 4 6
b. 1 3 7 5 9 8 4 6
c. 1 3 4 7 9 8 5 6
d. 1 3 4 5 9 8 7 6
Ans:b

31. What is the output of selection sort after the 3rd pass given the following sequence of numbers: 7 3 5 1 9 8 4 6
a. 1 7 5 3 9 8 4 6
b. 1 3 7 5 9 8 4 6
c. 1 3 4 7 9 8 5 6
d. 1 3 4 5 9 8 7 6
Ans:c

32. What is the output of selection sort after the 4th pass given the following sequence of numbers: 7 3 5 1 9 8 4 6
a. 1 7 5 3 9 8 4 6
b. 1 3 7 5 9 8 4 6
c. 1 3 4 7 9 8 5 6
d. 1 3 4 5 9 8 7 6
Ans:d

33. What is the output of selection sort after the 5th pass given the following sequence of numbers: 7 3 5 1 9 8 4 6
a. 1 7 5 3 9 8 4 6
b. 1 3 7 5 9 8 4 6
c. 1 3 4 7 9 8 5 6
d. 1 3 4 5 6 8 7 9
Ans:d

34. What is the output of selection sort after the 6th pass given the following sequence of numbers: 7 3 5 1 9 8 4 6
a. 1 3 4 5 6 7 8 9
b. 1 3 7 5 9 8 4 6
c. 1 3 4 7 9 8 5 6
d. 1 3 4 5 9 8 7 6
Ans:a

0 comments:

Advertisement

 

Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com