Wednesday, March 16, 2011

Reverse the Linked List in K pairs

Problem description and solution can be found at
http://geeksforgeeks.org/?p=8014

Main points here.

1)reverse the first K pairs by normal reverse technique.
2)one pointer will contain last element of the reversed list
3)special check for first time.. to change root and master prev node.
4) special check to end the list

Tuesday, March 15, 2011

Monolithic and microlithic kernel


http://welovec.blogspot.in/2011/04/difference-between-monolithic-and.html

Nothing to cram, funda is simple as their names. Mono means everthing in kernel space.
Micro means very minimal in kernel space.

Mono what goes into the kernel (kernel space)
Process management, memrory management, file system, i/o services etc. e.g Linux kernel;

Micro Kernels what goes into the kernel
very minimal support for the process management goes into the kernel, everything else all above mentioned things are implemented in user space.

These services in user space are called as servers. kernel communicates with them with message passing(IPC). e.g QNX





The main disdvantage of monolithic kernels is the dependency between system components - a bug might crash the entire system - and the fact that large kernels also

become difficult to mantain.

Other disadvantages are the kernel size, lack of extensibility and the bad maintainability. Bug-fixing or the addition of new features means a recompilation of the whole

ernel. This is time and resource consuming because the compilation of a new kernel can take severalhours and alot of memory. Everytime someone adds a new feature or

xes a bug, it means recompilation of the whole kernel.

Monday, March 14, 2011

Copy a linked list with next and arbit pointer

http://geeksforgeeks.org/?p=1155

Look at method Number 3.
The funda here is to insert new node in between the nodes of original ist in way like this

1-2-3-4-__

1-1-2-2-3-3-4-4__

The new node instered have random pointer as zero.

Now in second pass we will link the arb pointer as this

copyList->arbit = org->arb->next. this would work and we would reach to the replica of org node. as in our new node orgList next pointer is the node which will be our final node in the new list.


not in third pass. to modify correct the next pointer

like cop->next = copy->next->next
and org ->next = org->next->next.


set the last pointer of the org list to the zero.