now its clear.. thank you..
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more
@Nikhil
I am clear with your first 2 algos but not with the change u introduced ie.,
adding a check. please give a working example
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
@Divya :
Does the algo you gave work for the set { 6,5,9,111} ?
I hope it doesnt... Correct me if i am wrong
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe
XOR has the following problem...
assume array is 2,3,3,2,1,2
here the unique element is 1 but using XOR we get
2^3^3^2^1^2=3
XOR works only when all the elements except the unique element occur even
number of times.
--
You received this message because you are subscribed to the Google
sort the input and then compare each element i with its adjacent neighbors
ie., i-1 and i+1 if both are different then that element is the unique
one...
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
try this one..
make a level order traversal and store the elements in array... on the other
system reconstruct it using right element for the left and left element for
the right...
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to
In the first post the problem was that m_speed is not public also u should
access m_speed using Scope resolution operator as m_speed is not a member of
B.
class A
{
public:
virtual int speed()=0;
int m_speed;
};
class B:public A
{
public:
int speed()
{
return A::m_speed;
}
};
For ur second
For the 1st qn..
the o/p will print the code in the file and then print an infinite sequence
of empty spaces. the reason is...
In C EOF is defined to hold a value -1 which when assigned to unsigned
becomes 255. So it goes in an unending loop even after encountering the end
of file.
In second qn..
I missed out the condition that it should never be negative... Sorry for the
comment... Thanks for correcting...
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe