Hi
This type of function overloading works in c .
Execute following code and it will call function fun as per the
function parameter
code snip-in
-
#includestdio.h
void fun(const char *p)
{
printf(funsfsdafsf1\n);
}
void fun(char *P)
{
printf(fun2\n);
}
void
I think its a problem similar to finding out one good chip and one bad
chip in the given set.
If you get a good chip then you can find out the bad chip.
I think its a problem similar to finding a soilder which has a
infected blood or so... there is some problem based I dont remember.
I this
!);
else
bitmap[array[i]] = marked;
i++;
}
Thank You,
Mayur
On Nov 23, 3:25 pm, MJ [EMAIL PROTECTED] wrote:
Hi James,
As per your solution the variable pair can go negative and if Array[i] X,
and in that case you can not use bitmap[pair] which will give an
exception as we can
Hi
James, your approach is cool, The bitmap approach works in O(n),
but as mention by dave, it take extra memory and initialization.
If we dont want to use extra memory, can it be done in O(n)?
Thank You
MJ
On Nov 21, 8:11 pm, Dave [EMAIL PROTECTED] wrote:
Okay. This works better
, 2:22 pm, MJ [EMAIL PROTECTED] wrote:
Hi
James, your approach is cool, The bitmap approach works in O(n),
but as mention by dave, it take extra memory and initialization.
If we dont want to use extra memory, can it be done in O(n)?
Thank You
MJ
On Nov 21, 8:11 pm, Dave [EMAIL PROTECTED
HI Chandra,
As per the problem statement
Given an array of 0's and 1's whenever you encounter an 0 make
corresponding column and row elements 0.
Does it mean make all the rows and column zero or only last row and
column elemnt zero??
could you reframe the problem statement with more details
you can do it O(n) time if the input array is sorted.
Find the min and max value of the array and then decide how many
number can be eliminated based if they are greater than X.
This problem get complecated if we consider the integers are +ve as
well as -Ve intergers in an array.
But any way
Heap sort has a function heapify which will build the heap. If you
just modify this heapify algorithm to eliminate the repeated elemenst
it will work in O(nLogn).
Also this will work for any number of repeated elements. you can find
this algo in hte Design analysis and algorithms by Corment in