Algorithm+Analysis+ +Problem+(4)
Algorithm+Analysis+ +Problem+(4)
Analysis
EditEdit
MasterMaster
Class - Day 1
texttext
stylesstyles
Practice Questions
int a = 0, i = N;
while (i > 0) {
a += i;
i /= 2;
}
Practice Questions
Ans : O(log N)
We have to find the smallest x such that `N / 2^x < 1 OR 2^x > N`
x = log(N)
Practice Questions
Output = 1 2 , 1 3 , 2 3
Homework questions
int count = 0;
count += 1;
}
Homework questions
f2(n) = n^(3/2)
f3(n) = nLogn
f4(n) = n^(Logn)
Homework questions
Thank
you!