Tip of the week#1: Looping performance
Never use two loops if one loop will suffice. Example: for(i=0; i<5; i++) { /*Do something 1*/ } for(j=0; j<5; j++) { /*Do something 2*/ } In the above example, first and the second “for” loop will execute 5 times each. That is the total of 10 times. The performace of the above code can be optimized by using only one for loop as follows: for(i=0; i<5; i++) { /*Do something 1*/ /*Do something 2*/ } The above loop will be executed only 5 times. Thus the time required for execution is reduced. Note: If the instructions in the loop...