If-then-else statements, Data Structure & Algorithms

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).

Posted Date: 4/4/2013 5:55:18 AM | Location : United States







Related Discussions:- If-then-else statements, Assignment Help, Ask Question on If-then-else statements, Get Answer, Expert's Help, If-then-else statements Discussions

Write discussion on If-then-else statements
Your posts are moderated
Related Questions
The number of different directed trees with 3 nodes are ?? The number of disimilar directed trees with three nodes are 3

The information in the table below is available for a large fund-raising project. a. Determine the critical path and the expected completion time of the project. b. Plot the total

What is an unreachable code assertion An unreachable code assertion can be placed at the default case; if it's every executed, then program is in an erroneous state. A loop in

Threaded Binary Tree : If a node in a binary tree is not having left or right child or it is a leaf node then that absence of child node is shown by the null pointers. The spac

Q. Write down an algorithm to add an element in the end of the circular linked list.        A n s . Algo rithm to Add the Element at the End of Circular Linked Lists

Program segment for All pairs shortest paths algorithm AllPairsShortestPaths(int N, Matrix C, Matrix P, Matrix D) { int i, j, k if i = j then C[i][j] = 0  for ( i =

Explain in detail the algorithmic implementation of multiple stacks.


Define about the Structure - Container - Some containers hold elements in some sort of structure, and some don't. Containers with no structure include bags and sets. Containe

discuss the operating system under the following: MONOLITHIC SYSTEM,LAYER SYSTEM AND VIRTUAL MACHINES