What happens in the MinOfThree program if two or more of the values are equal? If exactly two of the values are equal, does it matter whether the equal values are lower or higher than the third?
What will be an ideal response?
If two or more values are equal, the program still prints the lowest value. Because only less than comparisons are made, the comparison of two equal values produces a false result. If two values are equal, and lower than the third value, then one of the two lower but equal values is printed. If all three values are equal, then this value is printed. Which “version” of the equal value is irrelevant.
If only two values are equal, it does not matter whether the third is lower or higher. The correct result is determined in either case. If the two equal values are lower than the third, then one of the two lower but equal values is printed. If the two equal values are higher than the third, then the third value is printed.
You might also like to view...
List nodes normally are not necessarily stored in contiguous memory. Rather, they’re ________ contiguous.
a. physically b. approximately c. comparably d. logically
Group accounts make it easier for an administrator to manage user rights and permissions.
Answer the following statement true (T) or false (F)
Before using hacking software over the Internet, you should contact which of the following? (Choose all that apply.)
a. Your ISP b. Your vendor c. Local law enforcement authorities to check for compliance d. The FBI
A 2-3 tree with n nodes cannot be taller than
a. log2(n + 1) b. log2(n) c. n + 1 d. 2n + 1