Initially when all processes arrived they spent 10% on i/o. SRTF they mentioned.
so initially p1 will be considered which has 10 BT. so 10% i/o is 1. ( 0 to 1 slot in Gantt chart )
then 40% CPU operation is 40% of 10 BT, which is 4. ( 1 to 5 slot in Gantt chart )
now p1 will go for i/o at that time other SRTF process p2 is ready and its i/o is already overlapped. so it will execute for 40% of 20 BT, which is 8. But it cannot execute for all 8 because p1 will be ready after 2 seconds and it will preempt p2. ( 5 to 7 slot in Gantt chart)
now p1 will execute 30% of 10 which is 3. (7 to 10 slot in Gantt Chart)
now p2 will execute for 6 which it left because of preemption... ( 10 to 16 slot in Gantt chart)
like this keep doing upto p4.
D is correct..
Because for this example you can not assign str[length] = '\0' ...
You can't assign null to specific char array index, as value represented by that index is char instead of pointer
In simple words, we can say variate is a set of random variables.
P(X=x), here X is a variate.
take u = mean
for Poisson, E(X) = u and VAR(X) = u
VAR(X) = E(X2) - E(X)2
u = 20 - u2
solving this, u=-5 and u=4
Hence ans is 'a'
You can find quality examples related to complexity in Narsimha Karumanchi book.. Just google it, pdf is available. You can try few related chapters of that book.
-> for (i=0 to N) will execute atmost N times
-> for (j=1 to i) will execute atmost i times, where imax=N , so N times
-> for (k=j to i+j) will execute atmost i times as initial value is k=j and last value is k=i+j (so from j to i+j means i times). Here imax=N, so N times
-> for(L=1 to i+j+k) will execute atmost i+j-k times, where imax=N, jmax=N, kmax=i+j = N+2N, so (i+j-k) = N+N-2N = -N (N times in descending order)
Hence, O( (N)(N)(2N)(N) ) = O(N4)
To cut a log into 4 pieces u need 3 cuts. (i think you understood everything from this sentence. :) )
To cut log into 3 pieces u need 2 cuts.
3 cuts : 4 minutes
2 cuts : ?
? = 8/3
Hence ans is D
Answer is quite simple..
they have asked number of candidate keys "possible"... so we can assume that they are interested in maximum number of candidate keys..
Now definition of candidate key is: CK is a single field or least combination of fields that uniquely defines a row.
So possible number of combinations are same as possible number of binary strings.
n + nC2 + nC3 + .. + nCn
For this we have to consider maximum number of combinations with same number of attributes.
for example.. if we have five attributes(A,B,C,D,E) then if we take individual attributes we can not take any other. But if we focus on AB, BC.. then we can consider all combinations with 2 attributes but not with 3 or 4. In this way we are getting maximum candidate keys.
If there are 6 attributes then we will get maximum CK at 6C3..
In general we can say, nCfloor(n/2) will give maximum combinations that we can consider as CK..
Critical section is a part of code that no more than one process may access concurrently.
Imagine a scenario, You have a bike and you and your friend want to go 100 km far.
Critical section: Your bike is a critical section, which gives different result if only you or only ur friend or both of u together drive it.
Mutual exclusion: You and your friend will mutually decide to drive alternatively for every 10 km distance.
For deadlock see the following image:
=> initially we have 2^44 byte LAS and page size = 2^14 byte
so size of 1st level page table=2^30 * 2^4 = 2^34 byte
=> now again do paging on this page table
size of 2nd level page table is=(2^34 / 2^14) * 2^4 = 2^24
=> now, size of 3rd level page table is = 2^10 * 2^4 = 2^14
this last page table can be fit into single page as page size is also 2^14.
therefore 3 level paging is required.