in this example suppose the statements are simple


In this example, suppose the statements are simple unless illustrious otherwise. if-then-else statements

if (cond) {

sequence of statements 1

}

else {

sequence of statements 2

}

In this, if-else statement, either sequence 1 will execute, or sequence 2 will execute based on the Boolean condition. In this case the worst-case time is the slower of the two possibilities. For instance, if sequence 1 is O(N2) and sequence 2 is O(1), then the worst-case time for the whole if-then-else statement would be O(N2).

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: in this example suppose the statements are simple
Reference No:- TGS0411911

Expected delivery within 24 Hours