Comp. Science
Programming and Technical
Category
Consider the following program
n = b1b2b3 .bm
int n, rev;
rev = 0;
while (n > 0) {
rev = rev * 10 + n %10;
n = n/10;
}
Read Solution (Total 0)
Comp. Science Other Question
Consider the following functions: f(n)= 3 n ? n ; g(n) = 3 n ? n n log 3 ; h(n) = n! Which of the following is true?
1. h(n) is O (f(n))
2. h(n) is O (g(n))
3. f(n) is O (g(n))
4. g(n) is not O (f(n))
Which of the following is true at the end of the ith iteration?
1. n = b1b2 bmi and rev = bm bm1 .bmi+1
2. n= bmi+1 .bm1bm and rev = bmi b2b1
3. n= b1b2 bm and rev = bm b2b1
4. none of these