Can use assistance with a discrete Math/Logic question regarding algorithms: udg
ID: 3167657 • Letter: C
Question
Can use assistance with a discrete Math/Logic question regarding algorithms:
udge the following reasoning as true or false. You are working for a tech company. You came up with an algorithm that performs a needed operation on n inputs in order of n operations. Someone else in the company simultaneously came up with an algorithm that performs the same task in order of login) operations. Then it follows necessarily that your algorithm will require more operations to perform this task and is therefore inferior and should not be used. True FalseExplanation / Answer
TRUE.
log(n) always less than 'n'.
Let us consider your algorithm take 10 operations for specific task ( n =10).
someone else algorithm requires log(n) i.e. log(10) = 1 operation.
It took only one operation,very less operations compare to you. Suppose time for operation is fixed, let's us consider 1 second for one operation, your algorithm took 10 seconds to complete and someone else algorithm took only 1 seconds,hence it requires very less time it simplifies the life. Hence it is recommended. So your code is inferior and should not be used.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.