Hi,
Can anyone tell me the difference between using an assignment operator
and copy constructor ?
sample s1;
sample s2;
s2=s1;
sample s3(s2);
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
i think it shud be 1/2.. i will try to prove it...
On Mon, Jun 28, 2010 at 8:52 AM, sharad kumar sharad20073...@gmail.comwrote:
Problem :- A line of 100 airline passengers is waiting to board a plane.
They each hold a ticket to one of the 100 seats on that flight. (For
convenience, let's say
ya its 1/2 proof gvn in www.techinterview.org
On Tue, Jun 29, 2010 at 12:37 PM, ankur aggarwal
ankur.mast@gmail.comwrote:
i think it shud be 1/2.. i will try to prove it...
On Mon, Jun 28, 2010 at 8:52 AM, sharad kumar sharad20073...@gmail.comwrote:
Problem :- A line of 100 airline
1/100
On Tue, Jun 29, 2010 at 12:37 PM, ankur aggarwal
ankur.mast@gmail.comwrote:
i think it shud be 1/2.. i will try to prove it...
On Mon, Jun 28, 2010 at 8:52 AM, sharad kumar sharad20073...@gmail.comwrote:
Problem :- A line of 100 airline passengers is waiting to board a plane.
hi friends i m new to this group, i found very interesting and useful
discussion here
this is code for adding two number without arithmetic operator
int add(int a, int b)
{
do
{
a=a^b;
b=(a^b)b;
b=b1;
I think it is NULL and we've to check for that condition, good that you
mentioned
On Tue, Jun 29, 2010 at 3:10 AM, Nivedita Rajani
nivedita.raj...@gmail.comwrote:
Small Doubt,
As stated for Leaf Nodes Right and left pointer is not NULL,
What about an internal node with only Left tree
http://www.codeguru.com/cpp/cpp/algorithms/general/article.php/c9585
On Tue, Jun 29, 2010 at 12:32 AM, Raj N rajn...@gmail.com wrote:
Hi,
Can anyone tell me the difference between using an assignment operator
and copy constructor ?
sample s1;
sample s2;
s2=s1;
sample s3(s2);
--
You
Hi All,
Is there any way to call our function before main() is called ?
I know there is a way in C++ as below , but Is there a standard way
in C ?
#include iostream.h
class CStatic
{
public:
CStatic() { cout Before Main! endl; }
~CStatic() { cout After Main! endl; }
};
CStatic cs;
Are you asking how to subtract 1 without using bitwise operators? If
so, just use subtraction.
Dave
On Jun 29, 10:32 am, Anand anandut2...@gmail.com wrote:
@ Dave: is it possible to get the previous without using bitwise operator.
On Mon, Jun 28, 2010 at 8:29 PM, Gene gene.ress...@gmail.com
Sorry. is it possible to get the previous number using bitwise operator and
with out using arithematic operator
On Tue, Jun 29, 2010 at 1:56 PM, Dave dave_and_da...@juno.com wrote:
Are you asking how to subtract 1 without using bitwise operators? If
so, just use subtraction.
Dave
On Jun
@ Abhishek,
Initially to start with let's take every Dept as Nodes and find the shortest
route between them. if this works we can extend it further for other areas
also.
On Mon, Jun 28, 2010 at 10:31 AM, Abhishek Sharma jkabhishe...@gmail.comwrote:
@senthil: thanks for the interest.. I did
On Jun 29, 4:58 pm, Anand anandut2...@gmail.com wrote:
Sorry. is it possible to get the previous number using bitwise operator and
with out using arithematic operator
On Tue, Jun 29, 2010 at 1:56 PM, Dave dave_and_da...@juno.com wrote:
Are you asking how to subtract 1 without using bitwise
On Jun 27, 7:32 am, sharad kumar sharad20073...@gmail.com wrote:
Algorithm to find if a tree is symmetric? (The tree is a generalized tree
with as many child nodes as possible)
Here's how to do it with a binary tree. Extension to an n-ary tree is
straightforward.
boolean is(a, b)
{
if (a ==
@DAVE GANE hi friends can any one explain working of program , i
hv seen this code many time but i don't now how it works can any one
explain it.. thanks
On 6/29/10, Anand anandut2...@gmail.com wrote:
@ Dave: is it possible to get the previous without using bitwise operator.
On Mon, Jun
A *complete binary tree* is a binary tree in which every level, *except
possibly the last*, is completely filled, and all nodes are as far left as
possible
write a code which check whether a given tree is complete or not
--
You received this message because you are subscribed to the Google
On 29 June 2010 20:31, Priyanka Chatterjee dona.1...@gmail.com wrote:
int add(int a, int b)
{
do
{
a=a^b;// sum without carry
b=((a^b)b)1;// carry without addition
} while(b);//when carry equal to 0 a contains the
int add(int a, int b)
{
do
{
a=a^b;// sum without carry
b=((a^b)b)1;// carry without addition
} while(b);//when carry equal to 0 a contains the sum
return(a);
}
Explanation:
We can add 2 no.s in the
On Jun 29, 3:26 pm, sharad kumar sharad20073...@gmail.com wrote:
how to sort an array containing 0's 1's and 2's in O(n)time and sorting
technique must be inplace
#define M 3
void sort(int *a, int n)
{
int i, j, c[M];
for (j = 0; j M; j++) c[j] = 0;
for (i = 0; i n; i++) ++c[a[i]];
18 matches
Mail list logo