丑数算法的大O(暴力法)
Link to problem: Ugly Numbers
您如何找到丑数的强力(简单方法方法)解决方案的大O。
我看到这部分代码:
/* Function to check if a number is ugly or not */
int isUgly(int no)
{
no = maxDivide(no, 2);
no = maxDivide(no, 3);
no = maxDivide(no, 5);
return (no == 1)? 1 : 0;
} ...