(i) Define a recurrence relation using Divide and Conquer technique and describe its
elements
(ii) Solve the following recurrence relation using Recurrence Tree Method.
T(π) = {1 π(π/2 ) + n
ππ n=1
ππ n> 1
Show all the steps.
(i) Identify two problems in each category of the following time complexities and derive the
complexity of these identified problems.
O(n log n), and O(n2).
(ii) Suppose you are given n sets: S1, S2β¦..Sn.. Each set is having n elements. The problem is
to find whether some pairs of these sets are disjoint, i.e. there are no common elements
in these sets. Write pseudo code and calculate its time complexity.
Calculate the time complexity of the following program fragments.
(a) πππ (π = 1; π β€ π; π β = 2)
{
π₯ = π₯ + 1
}
(b) πππ (π = 1; π β€ π; π + +)
πππ (π = 1; π β€ π; π = π β 2)
{
β¦ .
β¦ .
}
(a) Write a brute force method and Hornerβs algorithm to evaluate a polynomial expression
and compute their complexities
(b) Evaluate the following polynomial expression using Hornerβs rule. Assume the value of x
is 3.
p(π₯) = 10π₯5 + 6x4 + 3π₯3 β 6π₯2 + 8π₯ + 15
Show all the intermediate steps.
create a parent class "Account" with three variables num, title and bal with two functions withdraw and deposit. Create a child class "Saving Account" with a function calculate Profit (that applies 7.5% profit on current balance). Finally create the class "TestApp" that creates the object of saving account and call withdraw, deposit functions and public data memebers of account clas. Override withdraw function in savingAccount to deduct Rs:250 if the balance after withdrawal of amount is less than 10000. In javascript
Create a flowchart that display numbers from 100-1
As ICT/CSS student,what can you say about the use of VMware in these trying times?
If you will become a Systems Administrator someday,how will you secure the server for your clients?
Listdown at least 5 important roles of a server in business,education,governance and communications.
#include<stdio.h>
#include<conio.h>
void main(){
int num1, num2;
int temp=0;
printf("Enter two numbers");
scanf("%dΒ %d" ,&num1,&num2);
Β
while(((num1 + num2) % 5) !=0)
Β Β {
Β Β Β temp=num1+num2;
Β Β Β num1=num2;
Β Β Β num2= temp;
Β Β Β printf("%d",temp);
}
getch();
}