Answer:
All of these statements are true.
Explanation:
Since the while loop is reversing the integer number and leaving the highest order digit in the num and stores the reversed number in the newNum variable.
It skips one digit so if the num is in the range of [100,1000] it will result in a number between 10 and 100.
This loop can never go in infinite loop for any initial value of num because the loop will run as many times as the number of digits.
and if the value of the num is <=10 the while loop will never run and the value of newNum will be 0.
Answer:
O =C3+10-E3
Explanation:
Only addition and subtraction :D
Answer:
29
Explanation:
for n=28:
--------------
Algorithm 1 performs f(n) = n2 + n/2 = 28*28 + 28/2 = 798
Algorithm 2 performs f(n) = 12*28 + 500 = 836
for n=29
--------------
Algorithm 1 performs f(n) = n2 + n/2 = 29*29 + 29/2 = 855.5
Algorithm 2 performs f(n) = 12*29 + 500 = 848
so, for n=29, algorithm 2 will be faster than algorithm 1
Answer:
E. Genetic algorithms
Explanation:
In Computer science, Genetic algorithms are model building techniques where computers examine many potential solutions to a problem, iteratively modifying various mathematical models, and comparing the mutated models to search for a best alternative.