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
-
#include
void fun(const char *p)
{
printf("funsfsdafsf1\n");
}
void fun(char *P)
{
printf("fun2\n");
}
void main()
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 case
question goes like this (I also face this
> > problem
> > > earlier)...
>
> > > Given an array of 0s and 1s (whether the array can contain any other
> > > element apart from 0 and 1 is not mentioned in the question posted, but
> > to
> > > make it h
add it with pair.
Thanks James.
Thank You,
Mayur
On Nov 26, 8:52 pm, "James Fang" <[EMAIL PROTECTED]> wrote:
> Hi MJ,
>
> The negative "pair value" can be workarounded by normalizing the
> pair to be in the [0,MAX_INT] range.
> This c
gative
> if( bitmap[pair] == marked )// if pair is -
> ve value this operation is not allowed
> found the answer!
> else
>mark bitmap[array[i]]
>
> Thank You,
> Mayur
>
> On Nov 23, 2:22 pm, MJ <
Mayur
On Nov 23, 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)?
>
>
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 detail
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 b
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 Cha
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 sor
10 matches
Mail list logo