How does the modulo operation affects the time complexity of a program ?

Revision en1, by codemode, 2019-07-08 09:10:03

Say, I have an O(n^2) or O(n^3) solution to a problem . If I use the modulo operator in most of the statements inside the loops, will my program slow down ? With which factor will it slow down ? like 2*x,3*x,.. ? (if "x" is the execution time of the program when no modulo is used)

Tags modulo


  Rev. Lang. By When Δ Comment
en1 English codemode 2019-07-08 09:10:03 356 Initial revision (published)