These r d thigs i cud come up wid :( dont delete the node ..just mark the node as dummy node.... or implement your Linked list as a xor linked list http://en.wikipedia.org/wiki/XOR_linked_list
Implement a function getbits, that returns the(right adjusted) n bits that begin at position p of an integer. Assume bit position 0 is at the right end and that n and p are sensible positive values.
You are given n real numbers in an array. A number in the array is called a decimal dominant if it occurs more than n/10 times in the array. Give an O(n) time algorithm to determine if the given array has a decimal dominant.
copy the contents of the next node to the node which is to be deleted.
ReplyDelete@above what if it is the last node...
ReplyDeleteThese r d thigs i cud come up wid :(
ReplyDeletedont delete the node ..just mark the node as dummy node....
or implement your Linked list as a xor linked list
http://en.wikipedia.org/wiki/XOR_linked_list
@ankit can you please explain what do you mean by marking the node as dummy node...
ReplyDelete