Answer:
The answer is "Option c".
Explanation:
In the given question the device A is connected by 3 wires, contributing all of them, which also includes several connector paths. When all the wires of A are broken down, and if all of this leaves no routes that can be used. Even so, if it is done to E, it's also linked to four different routes. Its solution would've been C because its value will be the MINIMUM.
Answer:
See explaination for the program code
Explanation:
The code below
Pseudo-code:
//each item ai is used at most once
isSubsetSum(A[],n,t)//takes array of items of size n, and sum t
{
boolean subset[n+1][t+1];//creating a boolean mtraix
for i=1 to n+1
subset[i][1] = true; //initially setting all first column values as true
for i = 2 to t+1
subset[1][i] = false; //initialy setting all first row values as false
for i=2 to n
{
for j=2 to t
{
if(j<A[i-1])
subset[i][j] = subset[i-1][j];
if (j >= A[i-1])
subset[i][j] = subset[i-1][j] ||
subset[i - 1][j-set[i-1]];
}
}
//returns true if there is a subset with given sum t
//other wise returns false
return subset[n][t];
}
Recurrence relation:
T(n) =T(n-1)+ t//here t is runtime of inner loop, and innner loop will run n times
T(1)=1
solving recurrence:
T(n)=T(n-1)+t
T(n)=T(n-2)+t+t
T(n)=T(n-2)+2t
T(n)=T(n-3)+3t
,,
,
T(n)=T(n-n-1)+(n-1)t
T(n)=T(1)+(n-1)t
T(n)=1+(n-1)t = O(nt)
//so complexity is :O(nt)//where n is number of element, t is given sum
it is title page and give me a ❤
Answer:
numbers = 1:1:100;
for num=numbers
remainder3 = rem(num,3);
remainder5 = rem(num,5);
if remainder3==0
disp("Yee")
else
if remainder3 == 0 && remainder5 == 0
disp ("Yee-Haw")
else
if remainder5==0
disp("Haw")
else
disp("Not a multiple of 5 or 4")
end
end
end
end
Explanation:
- Initialize the numbers variable from 1 to 100.
- Loop through the all the numbers and find their remainders.
- Check if a number is multiple of 5, 3 or both and display the message accordingly.
If you include all zeroes, then it should be 1,000,000,000. Otherwise it’s 999,999,999.
Think of how between 0-9 theres 10 numbers, and use that logic towards 000000000-999999999