Professional Documents
Culture Documents
Software Testing: White Box Testing Black Box Testing Alpha Testing Beta Testing
Software Testing: White Box Testing Black Box Testing Alpha Testing Beta Testing
1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0;
int keyPosition = -1;
1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0;
2
int keyPosition = -1;
1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0; F
2
int keyPosition = -1;
F
while( bottom2<= top && keyPosition == -1 ) {
mid = ( top + bottom ) / 2;
if( sequence[ mid ] == key ) {
keyPosition = mid;
}
else {
if( sequence[ mid ] < key ) {
bottom = mid + 1;
}
else {
top = mid - 1;
}
10
}
}
10 return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {
1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0; F
2
int keyPosition = -1;
T
T
F
while( bottom2<= top && keyPosition
3 == -1 ) { 3
mid = ( top + bottom ) / 2;
if( sequence[ mid ] == key ) {
keyPosition = mid;
}
else {
if( sequence[ mid ] < key ) {
bottom = mid + 1;
}
else {
top = mid - 1;
}
10
}
}
10 return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {
1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0; F
2
int keyPosition = -1;
T
T
F F 3
while( bottom2<= top && keyPosition
F 3 == -1 ) {
mid = ( top + bottom ) / 2;
if( sequence[ mid ] == key ) {
keyPosition = mid;
}
else {
if( sequence[ mid ] < key ) {
bottom = mid + 1;
}
else {
top = mid - 1;
}
10
}
}
10 return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {
1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0; F
2
int keyPosition = -1;
T
T
F F 3
while( bottom2<= top && keyPosition
F 3 == -1 ) {
mid = ( top + bottom ) / 2; T T
if( sequence[ 4
mid ] == key ) { 4
keyPosition = mid;
}
else {
if( sequence[ mid ] < key ) {
bottom = mid + 1;
}
else {
top = mid - 1;
}
10
}
}
10 return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {
1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0; F
2
int keyPosition = -1;
T
T
F F 3
while( bottom2<= top && keyPosition
F 3 == -1 ) {
mid = ( top + bottom ) / 2; T T
T 4
if( sequence[ mid ] == key ) { 4
5
keyPosition = mid;
T
}
else {
5
if( sequence[ mid ] < key ) {
bottom = mid + 1;
}
else {
top = mid - 1;
}
10
}
}
10 return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {
1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0; F
2
int keyPosition = -1;
T
T
F F 3
while( bottom2<= top && keyPosition
F 3 == -1 ) {
mid = ( top + bottom ) / 2; T T
T 4
if( sequence[ mid ] == key ) { 4
F
5 = F
keyPosition mid;
T
}
else {
6 5
if( sequence[6mid ] < key ) {
bottom = mid + 1;
}
else {
top = mid - 1;
}
10
}
}
10 return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {
1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0; F
2
int keyPosition = -1;
T
T
F F 3
while( bottom2<= top && keyPosition
F 3 == -1 ) {
mid = ( top + bottom ) / 2; T T
T 4
if( sequence[ mid ] == key ) { 4
F
5 = F
keyPosition mid;
T
}
else {
6 5
if( sequence[6mid ] < key ) {
bottom = mid + 1;
}
else {
top = mid - 1;
9
}
10
}
9
}
10 return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {
1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0; F
2
int keyPosition = -1;
T
T
F F 3
while( bottom2<= top && keyPosition
F 3 == -1 ) {
mid = ( top + bottom ) / 2; T T
T 4
if( sequence[ mid ] == key ) { 4
F
5 = F
keyPosition mid;
T
}
else {
6 5
T 6mid ] < key ) {
if( sequence[ T
bottom7= mid + 1;
7
}
else {
top = mid - 1;
9
}
10
}
9
}
10 return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {
1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0; F
2
int keyPosition = -1;
T
T
F F 3
while( bottom2<= top && keyPosition
F 3 == -1 ) {
mid = ( top + bottom ) / 2; T T
T 4
if( sequence[ mid ] == key ) { 4
F
5 = F
keyPosition mid;
T
}
else {
6 5
F
T 6mid ] < key ) {
if( sequence[ T
F 1;
bottom7= mid +
8 7
}
else {
8 - 1;
top = mid
9
}
10
}
9
}
10 return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {
1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0; F
2
int keyPosition = -1;
T
T
F F 3
while( bottom2<= top && keyPosition
F 3 == -1 ) {
mid = ( top + bottom ) / 2; T T
T 4
if( sequence[ mid ] == key ) { 4
F
5 = F
keyPosition mid;
T
}
else {
6 5
F
T 6mid ] < key ) {
if( sequence[ T
F 1;
bottom7= mid +
8 7
}
else {
8 - 1;
top = mid
9
}
10
}
9
}
10 return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {
1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0; F
2
int keyPosition = -1;
T
T
F F 3
while( bottom2<= top && keyPosition
F 3 == -1 ) {
mid = ( top + bottom ) / 2; T T
T 4
if( sequence[ mid ] == key ) { 4
F
5 = F
keyPosition mid;
T
}
else {
6 5
F
T 6mid ] < key ) {
if( sequence[ T
F 1;
bottom7= mid +
8 7
}
else {
8 - 1;
top = mid
9
}
10
}
9
}
10 return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {
1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0; F
2
int keyPosition = -1;
T
T
F F 3
while( bottom2<= top && keyPosition
F 3 == -1 ) {
mid = ( top + bottom ) / 2; T T
T 4
if( sequence[ mid ] == key ) { 4
F
5 = F
keyPosition mid;
T
}
else {
6 5
F
T 6mid ] < key ) {
if( sequence[ T
F 1;
bottom7= mid +
8 7
}
else {
8 - 1;
top = mid
9
}
10
}
9
}
10 return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
This is What I Got after the tracing the
algorithm
START
hasWings
F T
Legs == 8 Legs == 6
T
F
T F
“Fly”
Legs > 10
“Spider”
Legs == 4 T
T “Grass
Hopper”
F
Legs < 200
F F
T
END
“Millipede”