Question: Counting Operations If the function return type void it should be modified to return the count of its operations; if the function already has a



Counting Operations If the function return type void it should be modified to return the count of its operations; if the function already has a return value, the count should be assigned to an integer reference parameter. This reference parameter should always be the last parameter in the function's parameter list. When counting operations follow these rules. 1. An executable statement (a line of code that ends in a semi-colon) or a comparison counts as one operation regardless of its complexity see exceptions 2 and 5. Therefore, the statement X = 4; counts as a single operation as does the statement int W = x + y + Z;. 2. Exception to 1 - if a statement includes a function call that does not run in constant time its operation count should be the number of operations performed by that function call. This only applies to questions 5 and 6. 3. Note to 1 and 2 statements that include the output operator (
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
