dontulakapil
BAN USERfork() loads resources of its parent. Where as exec loads resources (image) of executable in the path.
So the answer is exec() after fork()
Dynamically linked libraries can be shared among different processes where as static linked libraries can not be shared and if 2 processes have static linked libraries same part of library should be loaded twice in memory. Where as dynamic linked library allows to share the code of dynamic linked library among processes
- dontulakapil November 19, 2012The Heap area is shared by all shared libraries and dynamically loaded modules in a process.
- dontulakapil November 19, 2012semaphore t1(0),t2(0)
T1()
{
....
t2.signal()
t1.wait()
}
T2()
{
....
t1.signal()
t2.wait()
}
it can be done using xor.
xor of all given elements and number in range(1,n). will give xor of number not present in array(let it be a), number present twise in array (b).
as we get a xor b.
now we can use the algo of finding 2 non repeated elements of array and numbers in range(0,n). in order on n
We have to save the final compressed data with number of levels of compression for uncompressing the data. As we have been asked to design a functionality like zip, we should consider both zip and unzip.
- dontulakapil November 11, 2012We can use preorder traversal for n array tree. similar to tree.
- dontulakapil November 11, 2012Sort the arrays using heap sort, as it takes no extra space. Heap sort is better than quick sort as worst case of heap sort is O(nlogn), where as quick sort has worst case O(n2).
- dontulakapil November 11, 2012Yes we can add array1 to array 2 and do a heap sort with order (m+n)log(m+n).
- dontulakapil November 11, 2012Worst case of quick sort is O(n2). if we take input as sorted array for quick sort, with last element as pivot, it takes O(n2) time.
Recurrence relation is
T(n)=T(n-1)+O(n)
As there are 26 characters, rather than sorting by counting sort. We can directly use hashmap with complexity O(n)+O(m). With extra space of O(1) (if number of characters is limited to 26)
- dontulakapil November 09, 2012
- dontulakapil December 01, 2012