struct node * Rec_Reverse(struct node *p, struct node *q)
{
static struct node *r;
if(q-next!=NULL)
Rec_Reverse(p-next,q-next);
if(set == 0)
{r=q;
set++;
}
q-next = p;
p-next=NULL;
return r;
}
This method has to
Garbage collection is totally JVM dependent... Some JVMs may use a mark and
sweep algorithm.
The first thing u should understand abt Java's garbage collection is totally
unpredicatble. You cant really predict when garbage collection is done. If
and when the JVM decides that garbage coll should be
233 is the right answer..
On Fri, Jul 29, 2011 at 12:27 PM, shiv narayan narayan.shiv...@gmail.comwrote:
solutions for cow questions:
if we consider first cow would she calf at age 2 then first new cow
would come at age two.
at end of 2nd year: 1st would give new cow:
at end of 3rd year:1st
what does n mod 2's job here?
the only possible return case is when n/2 is 0 or 1
On Sat, Jul 30, 2011 at 2:04 PM, saurabh singh saurab...@gmail.com wrote:
And yes the formula is derived by the fact that x^(a+b)=x^a*x^b
and then think top down with respect to a general variable n.(That is
plz xplain y it is printing zero ...means how dis prgrm is wrkng step by
step
On Sun, Jul 31, 2011 at 11:03 AM, rajeev bharshetty rajeevr...@gmail.comwrote:
*#includestdio.h*
*#ifdef getchar*
*#undef getchar*
*#else*
*#define getchar scanf(%c,ch);*
*#endif*
*main()*
*{*
*char
i got it
On Sun, Jul 31, 2011 at 11:08 AM, SHIVAM AGRAWAL shivi...@gmail.com wrote:
plz xplain y it is printing zero ...means how dis prgrm is wrkng step by
step
On Sun, Jul 31, 2011 at 11:03 AM, rajeev bharshetty
rajeevr...@gmail.comwrote:
*#includestdio.h*
*#ifdef getchar*
One more query. What if the architecture is 64 bit, but the OS is 32 bit?
(Example windows XP)
What will be the size of a pointer variable then?
On Sat, Jul 30, 2011 at 8:00 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote:
@Aditi, Isn't the size of int variable 4 bytes in both the
Hi Vaibhav
On 30 July 2011 23:40, vaibhav shukla vaibhav200...@gmail.com wrote:
please give a glimps of how garbage collection is done in java.
how *System.gc()* works ?
Please do not use ALL CAPS in subject line. It is a bit scary :)
--
best wishes!!
Vaibhav
--
You
@Aditi, Isn't the size of int variable 4 bytes in both the architectures?
On Sat, Jul 30, 2011 at 12:52 PM, aditi garg aditi.garg.6...@gmail.comwrote:
it can also be found out by using printf(%d,sizeof(int)*8);
Correct me if i am wrong...
On Sat, Jul 30, 2011 at 11:55 AM, rajeev bharshetty
I think it might help...
struct node
{
int coef; /* A,B,C */
int var; /* x */
unsigned int exp;/* power of x */
struct node *next; /* next term in polynomial equation */
};
typedef struct node NODE;
Regards.
On Fri, Jul 29, 2011 at 7:32 PM, saurabh singh
Its NP problem. :-|
On Sat, Jul 30, 2011 at 4:14 PM, saurabh singh saurab...@gmail.com wrote:
Its the same as we divide teams.Pick the Largest in one and second largest
in other,then putting the remaining best player to the team which is weaker.
the weakest get selected last.if the teams are
Create a data structure where inserting, deleting and finding the
minimum element all have O(1) time.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this
scanf returns the number of characters scanned as input,in here the scanf
statement gets placed at getchar and hence since it accepts 1 character 'c'
will print the value 1.
#ifdef getchar checks for whether getchar is defined if defined it undefines
it as #undef
else
it #define getchar as scanf
yupthnx
On Sun, Jul 31, 2011 at 12:28 PM, rajeev bharshetty rajeevr...@gmail.comwrote:
scanf returns the number of characters scanned as input,in here the scanf
statement gets placed at getchar and hence since it accepts 1 character 'c'
will print the value 1.
#ifdef getchar checks
@Nikhil the size of pointer is same as int i guess...so it differs on diff
machines...im not sure abt ur OS and architecture doubt tho...
On Sat, Jul 30, 2011 at 8:02 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote:
One more query. What if the architecture is 64 bit, but the OS is 32 bit?
@Nikhil
Once the rabbits are mature, they should be able to produce babies every
month. after 2 months a female produces new babies for first time.
but then they should be able to produce a new pair at the end of the third
month as they can again mate at the end of second month.
Like in the cow
In the problem statement, the rabbits give birth to new ones after every 2
months. Not after each month.
On Sun, Jul 31, 2011 at 12:51 PM, Tushar Bindal tushicom...@gmail.comwrote:
@Nikhil
Once the rabbits are mature, they should be able to produce babies every
month. after 2 months a female
144 pairs
correct me if im wrong
On Sun, Jul 31, 2011 at 1:00 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote:
In the problem statement, the rabbits give birth to new ones after every 2
months. Not after each month.
On Sun, Jul 31, 2011 at 12:51 PM, Tushar Bindal tushicom...@gmail.comwrote:
Suppose that our rabbits never die and that the female always
produces one new pair (one male, one female) *every month from the
second month on
*
@Priyanka
You have answer 288
I added 178 to it because I got the answer that 89 females would have given
birth in the last month.
Pls clarify.
Are
Oops. My bad. Rabbits produce every month too.
I overlooked that.
On Sun, Jul 31, 2011 at 1:24 PM, Tushar Bindal tushicom...@gmail.comwrote:
Suppose that our rabbits never die and that the female always
produces one new pair (one male, one female) *every month from the
second month on
*
using map ?? key - string , value - count..print d string whose count
is 1..
On Jul 19, 8:49 pm, pacific :-) pacific4...@gmail.com wrote:
sorry.
On Tue, Jul 19, 2011 at 9:07 PM, Shubham Maheshwari
shubham.veloc...@gmail.com wrote:
what is meant by unique string ...!!
A string
This is discussed before I think. It will be in O(n).
On Jul 31, 1:15 pm, siva viknesh sivavikne...@gmail.com wrote:
using map ?? key - string , value - count..print d string whose count
is 1..
On Jul 19, 8:49 pm, pacific :-) pacific4...@gmail.com wrote:
sorry.
On Tue, Jul 19,
here we just undefining wat we defined rite then wat is the use
of ifdef undef..we can directly use as #define getchar ...na
!!
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
for the cows ques ... you all are forgetting to add the orginal starting cow
...
thus the answer should be *233*
On Sun, Jul 31, 2011 at 1:30 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote:
Oops. My bad. Rabbits produce every month too.
I overlooked that.
On Sun, Jul 31, 2011 at 1:24 PM,
Q1- A large size array is given. All except one element are repeated even
no. of times and one element is repeated odd no. of times. Find that
element. Don't use X-OR
Ans - Is there any efficient way of finding it without using sorting or
removing duplicates or using hash tables??
Q2- Same qn
tats bcos...
if it is a^21...
it will be (a^21/2)*(a^21/2)*(a^21mod2)
= (a^10)*(a^10)*(a^1)
correct me if i'm wrong
--
cheers
priyanka
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
1. Given words in a newspaper as input find the words that have occured oly
once
2. Find the 5 most repeating words in a given document
...Is there any other optimal solutions other than using map ??
--
Regards,
$iva
--
You received this message because you are subscribed to the Google
if OS installed is of 32 bit ... then compiler will work as working on a 32
bit architecture ... and give the results accordingly ...
@aditi :: i am not so sure abt your stateent regarding the size of pointer
and an int being th same ... could you plzz quote the reference for the same
...
On
use a doubly linked list ... with a field node *min.
weneva you insert an element ... check for the value of min at the head ...
if the new inserted node has less value ... then set the min field to point
to itself else copy the min field of te previous head.
insertion and deletion is easy
write a c program to print the following
*
* *
* * *
* *
*
--
cheers
priyanka
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To
using LL u cant delete in O(1) ... u have to traverse from head
On Jul 31, 1:47 pm, Shubham Maheshwari shubham@gmail.com wrote:
use a doubly linked list ... with a field node *min.
weneva you insert an element ... check for the value of min at the head ...
if the new inserted node has
its a *doubly* linked list ...
you can easily do the job ...
On Sun, Jul 31, 2011 at 2:23 PM, siva viknesh sivavikne...@gmail.comwrote:
using LL u cant delete in O(1) ... u have to traverse from head
On Jul 31, 1:47 pm, Shubham Maheshwari shubham@gmail.com wrote:
use a doubly linked
How do we declare an array of N pointers to functions that return int??
An array of N pointers to integers is this: int *p[N]
Just can't figure out the case for pointers to function
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view
Is it right??
declare an array of pointers like, int *func[N];
and since they are pointers to functions, modify above as, int
(*func[N])();
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
On Sun, Jul 31, 2011 at 2:20 PM, priyanka raju priyark...@gmail.com wrote:
write a c program to print the following
*
* *
* * *
* *
*
What complexity is expected?
Regards,
B.C.Someshwar
--
'Talk sense to a fool and he calls you foolish.' -
@shubham...i have a doubt.can't the same be done with singly linked list??
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
*Given an nxn screen, Each pixel is represented by intensity values. Given
a specific pixel as an input, find the no. of pixels of the same colour
which can reached from this pixel. Assume any suitable data structure for a
screen.
..can this be implemented through BFS ...similar to BITMAP prob
you mean circular linked list ...!!!
in case of stack ... we cn do it via SSL ...
for a queue implementation ... we will ned circular, or doubly for deletion
in O(1).
On Sun, Jul 31, 2011 at 2:38 PM, naveen ms naveenms...@gmail.com wrote:
@shubham...i have a doubt.can't the same be done with
color and intensity are2 different things ...
do you mean to find pixels with same intensity ...!!
and wat is meant by can be reached ...!!
On Sun, Jul 31, 2011 at 2:40 PM, sivaviknesh s sivavikne...@gmail.comwrote:
*Given an nxn screen, Each pixel is represented by intensity values.
Given a
Use a circular linked list with elements being inserted in sorted order.
Inserting minimum element :
struct node *p;
p is a pointer to last node in the circular singly linked list.
newmin-next=p-next;
p-next=newmin;
Deleting minimum element:
struct node *temp;
temp=p-next;
p-next=p-next-next;
yup its correct...
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit
hw cn u ensure that the elements are inserted in sorted order ...
wat if the elements are coming randmly ...
On Sun, Jul 31, 2011 at 2:49 PM, muthu raj muthura...@gmail.com wrote:
Use a circular linked list with elements being inserted in sorted order.
Inserting minimum element :
it should.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this
What is meant by 'priority' and 'severity' of a bug..?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
@shubham maheshawari
deletion can't be performed in O(1).
after extracting the min element, we need to find the next minimum element,
and worst case will take O(n) time.
On Sun, Jul 31, 2011 at 3:00 PM, Shubham Maheshwari
shubham@gmail.comwrote:
hw cn u ensure that the elements are
If the function takes in an int argument, then is it modified to
int (*func[N]) (int); ?
On Sun, Jul 31, 2011 at 2:56 PM, ankit sambyal ankitsamb...@gmail.comwrote:
yup its correct...
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To
Is it possible to terminate this code(except break) while it is
executing..? For what eof will this terminate..?
#includestdio.h
main(int argc,char *argv[])
{int c;
while((c=getchar())!=EOF)
{
putchar(c);
}
}
Reply fast...
--
You received this
@Nikhil
yes.
On Sun, Jul 31, 2011 at 3:02 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote:
If the function takes in an int argument, then is it modified to
int (*func[N]) (int); ?
On Sun, Jul 31, 2011 at 2:56 PM, ankit sambyal ankitsamb...@gmail.comwrote:
yup its correct...
--
You
What are smart pointers and what is the concept of pointer to void..?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
take countr to be a static variable ... that shud do the job ...!!
btw ...if thats nt the case ... thn i m nt pretty sure wat u are asking to
be done ...
On Sun, Jul 31, 2011 at 2:12 AM, Rahul Mittal rahulmitta...@gmail.comwrote:
help me with this
we need to find out how many times a function
compiler : gcc, OS : Fedora 15
I use ctrl + d to put EOF in files.
you can verify it through this code
#includestdio.h
int main(int argc,char *argv[])
{int c;
while((c=getchar())!=EOF)
{
putchar(c);
}
if(c==EOF)
printf(EOF Break);
return 0;
Can we write a code to generate random numbers without using rand function..?
Pls help me on this!!
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this
the operation is nt extract min ... its *find* min ...
On Sun, Jul 31, 2011 at 3:02 PM, Abhishek Gupta gupta.abh...@gmail.comwrote:
@shubham maheshawari
deletion can't be performed in O(1).
after extracting the min element, we need to find the next minimum element,
and worst case will
Is the eof different for different OS's..?
On 7/31/11, Abhishek Gupta gupta.abh...@gmail.com wrote:
compiler : gcc, OS : Fedora 15
I use ctrl + d to put EOF in files.
you can verify it through this code
#includestdio.h
int main(int argc,char *argv[])
{int c;
itoa is not standard..
On Sun, Jul 31, 2011 at 3:01 PM, saurabh modi
saurabhmodi102...@gmail.comwrote:
it should.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To
yup you are right.prakash try some cases and you will get why its necessary.
(Yup i agree can be written in an if else way but i like it this way better)
On Sun, Jul 31, 2011 at 2:08 PM, priyanka raju priyark...@gmail.com wrote:
tats bcos...
if it is a^21...
it will be
I am only using linux. google it. it must be some ctrl + any key sequence
On Sun, Jul 31, 2011 at 3:12 PM, Puneet Gautam puneet.nsi...@gmail.comwrote:
ctrl+D doesnt work on dev , os windows 7...
On 7/31/11, Puneet Gautam puneet.nsi...@gmail.com wrote:
Is the eof different for different
http://ideone.com/IZKyN
could you plzz explain this to me ...!!
anyone ...
On Sun, Jul 31, 2011 at 1:56 AM, Kamakshii Aggarwal
kamakshi...@gmail.comwrote:
@sanchit:no,not at all :)
On Sun, Jul 31, 2011 at 1:55 AM, Sanchit Manchanda
sanchit...@gmail.comwrote:
@kamakshi- sorry if you felt
On Sun, Jul 31, 2011 at 3:09 PM, Puneet Gautam puneet.nsi...@gmail.com wrote:
Can we write a code to generate random numbers without using rand function..?
Pls help me on this!!
How about operating on some garbage value?
Regards,
B.C.Someshwar
--
'Talk sense to a fool and he calls you
Qn is : Create a data structure where inserting, deleting and finding the
minimum element all have O(1) time.
so after deleting the minimum element, where will you point min pointer?
Sorry if i m wrong
On Sun, Jul 31, 2011 at 3:11 PM, Shubham Maheshwari
shubham@gmail.comwrote:
the
yeah,only some compilers support it.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For
Now its NP:)
On Sun, Jul 31, 2011 at 2:24 PM, Shubham Maheshwari
shubham@gmail.comwrote:
wat if you had to divide the array in 'n' groups ...
and the difference in the number of members in any 2 groups should not be
more than '1'.
the difference between their cumulative strengths is
i am givin solution for implementing a queue or a stack ...
in which ...inserting, delelting and finding min element is of O(1).
hope this is clear now ...
On Sun, Jul 31, 2011 at 3:19 PM, Abhishek Gupta gupta.abh...@gmail.comwrote:
Qn is : Create a data structure where inserting, deleting and
Plz tell about the type of questions asked by individual profiles .
--
*With Regards :*
Ravinder Kumar
B.Tech Final Year
Computer Science and Engineering
MNNIT Allahabad
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this
Can you explain the question more ??
--
*With Regards :*
Ravinder Kumar
B.Tech Final Year
Computer Science and Engineering
MNNIT Allahabad
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
#includestdio.h
int main()
{
int i,j,n;
printf(\n Enter the value of n);
scanf(%d,n);
for(i=1;i=n;i++)
{
for(j=1;j=n-i;j++)
printf( );
for(j=1;j=i;j++)
printf(*);
printf(\n);
}
for(i=1;i=n;i++)
{ for(j=1;j=i;j++)
printf( );
for(j=1;j=n-i;j++)
printf(*);
ctrl+z for win
On Sun, Jul 31, 2011 at 3:18 PM, Abhishek Gupta gupta.abh...@gmail.comwrote:
I am only using linux. google it. it must be some ctrl + any key sequence
On Sun, Jul 31, 2011 at 3:12 PM, Puneet Gautam puneet.nsi...@gmail.comwrote:
ctrl+D doesnt work on dev , os windows 7...
a Slight change to the previous program Here it goes
#includestdio.h
int main()
{
int i,j,n;
printf(\n Enter the value of n);
scanf(%d,n);
for(i=1;i=n;i++)
{
for(j=1;j=n-i;j++)
printf( );
for(j=1;j=i;j++)
printf( *);
printf(\n);
}
for(i=1;i=n;i++)
{ for(j=1;j=i;j++)
*#includestdio.h*
*
*
*int main()*
*{*
*
*
*int x,a,b,i,n;*
*printf(\n Enter the value of n);*
*scanf(%d,n);*
*printf(\n Enter Psoitive integer a);*
*scanf(%d,a);*
*printf(\n Enter the positisve integer b);*
*scanf(%d,b);*
*for(i=1;i=15;i++)*
*{*
* n= (a*n + b);*
* printf(%d\n,n);*
*}*
*return 0;*
here is what i think should be done to do thees operations in O(1)it is
quite popular interview question..
i am using two stacks
one stack arr[] in which elements in the elements will be pushed as they are
normally done in a stack
maintain another stack min[]whenever you insert an element
Guys the real question is :
Design a data structure which support following operation
1. insertion of an arbitrary element
2. removing the oldest element
3. Accessing min element
--
*With Regards :*
Ravinder Kumar
B.Tech Final Year
Computer Science and Engineering
MNNIT Allahabad
--
You
Given two integers A B. Determine how many bits required to convert A to
B. Write a function int BitSwapReqd(int A, int B);
--
Nikhil Gupta
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
C= A^B then count number of bits set in C.
On Sun, Jul 31, 2011 at 5:52 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote:
Given two integers A B. Determine how many bits required to convert A to
B. Write a function int BitSwapReqd(int A, int B);
--
Nikhil Gupta
--
You received this
@priyanka : thank you
On Sun, Jul 31, 2011 at 3:17 PM, saurabh singh saurab...@gmail.com wrote:
yup you are right.prakash try some cases and you will get why its
necessary.
(Yup i agree can be written in an if else way but i like it this way
better)
On Sun, Jul 31, 2011 at 2:08 PM,
int mypow(int x,int m)
{
if(m==0)
return 1;
if(m==1)
return x;
return mypow(x,ceil((float)m/2))*mypow(x,m/2);
}
On Sat, Jul 30, 2011 at 1:02 PM, arvind kumar arvindk...@gmail.com wrote:
Find the least time complexity algorithm(most efficient algo) to find
x^m(x to
@saurabhsingh --- i don't understand python at the moment..can u code
the same in c/c++
it would be very kind of you if you do it. or at least explain how are
you proceeding...
--
Amol Sharma
Third Year Student
Computer Science and Engineering
MNNIT Allahabad
On Sun, Jul 31, 2011 at
given an array containing +ve n -ve numbers , can someone give
efficient algo to find the max cont subarray product.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To
int BitSwap(int A,int B)
{
int num=A^B;
int count=0;
while(num!=0)
{
num=num(num-1);
count++;
}
return count;
}
this will run in O(m) where m is no. of ON bits (1's).
is there any other optimal solution for finding no. of 1's in a number?
On Sun, Jul 31, 2011 at
http://www.softwaretestinghelp.com/priority-and-severity/
On Sun, Jul 31, 2011 at 3:02 PM, Puneet Gautam puneet.nsi...@gmail.comwrote:
What is meant by 'priority' and 'severity' of a bug..?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
http://ootips.org/yonat/4dev/smart-pointers.html
Dis cud be helpful fr smart pointers
On Sun, Jul 31, 2011 at 3:06 PM, Puneet Gautam puneet.nsi...@gmail.comwrote:
What are smart pointers and what is the concept of pointer to void..?
--
You received this message because you are subscribed
can any one please explain me the question clearly with an examplei'm
not geting it!
thanx in advance!
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from
compare bits of the number one by one and and count how many are different
print the count..
correct if i am wrong !!
--
Amol Sharma
Third Year Student
Computer Science and Engineering
MNNIT Allahabad
On Sun, Jul 31, 2011 at 6:29 PM, Surya Prakash suryaprakash...@gmail.comwrote:
can
I had put comments for the same...The code coming as soon as I reaches
my laptop.
Do the same as u will do for converting for binary...except divide by -2
each time and donr let the remainder become -ve at any time take the higher
integer,
On Sun, Jul 31, 2011 at 6:13 PM, Amol Sharma
we can just apply xor operation rightit's more easier!!
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
http://ideone.com/9Txzo
U cannot use %d when trying to print address \dey dont fall in range...and
iu have modified it...u can chk the output..
i think ull be able to interpret the results...lemme knw if u have any
doubt...
On Sun, Jul 31, 2011 at 3:18 PM, Shubham Maheshwari
@Surya, ^ operator mean XOR operation.
On Sun, Jul 31, 2011 at 6:41 PM, Surya Prakash suryaprakash...@gmail.comwrote:
we can just apply xor operation rightit's more easier!!
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to
This is anothr prog that i ran...
http://ideone.com/Kw9xl
On Sun, Jul 31, 2011 at 6:43 PM, aditi garg aditi.garg.6...@gmail.comwrote:
http://ideone.com/9Txzo
U cannot use %d when trying to print address \dey dont fall in range...and
iu have modified it...u can chk the output..
i think ull be
Q1-Construct a binary tree , in such a way that if element occured for the
first time , insert into tree , if occurs at second time , remove from the
list.
As all elements except the one need to find are even , at the end of the
list , all the tree will contain only one element.
Q2- Construct a
yupxor would do the required task eaisly !!
--
Amol Sharma
Third Year Student
Computer Science and Engineering
MNNIT Allahabad
On Sun, Jul 31, 2011 at 6:42 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote:
@Surya, ^ operator mean XOR operation.
On Sun, Jul 31, 2011 at 6:41 PM, Surya
you can read up the
http://en.wikipedia.org/wiki/Negative_base#Calculationpart on the wiki
page
http://en.wikipedia.org/wiki/Negative_base
its explained quite effectively.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group,
yeah if it was a divisibility test then the question would have been too
trivial ..
the last digit after doing itoa will be the remainder .
On Sat, Jul 30, 2011 at 11:52 AM, nivedita arora
vivaciousnived...@gmail.com wrote:
i think solution of ankit is right !
sorry even i forgot tht que ws
How to swap two pointers without using a temporary pointer ?
--
Nikhil Gupta
Senior Co-ordinator, Publicity
CSI, NSIT Students' Branch
NSIT, New Delhi, India
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email
use xor ing for the same
On Sun, Jul 31, 2011 at 7:15 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote:
How to swap two pointers without using a temporary pointer ?
--
Nikhil Gupta
Senior Co-ordinator, Publicity
CSI, NSIT Students' Branch
NSIT, New Delhi, India
--
You received this
the answer is 144 she-calves..the qn asks for calves, not cows and
calves..in all there are 233 cows n calves where there are 144 calves n 89
cows
On Sun, Jul 31, 2011 at 2:02 PM, Shubham Maheshwari
shubham@gmail.comwrote:
for the cows ques ... you all are forgetting to add the orginal
*#includestdio.h*
*int main()*
*{*
*int i=10;*
*int j=20;*
*int *a,*b;*
*a =i;*
*b=j;*
*printf(before%d%d\n,*a,*b);*
**a^=*b;*
**b^=*a;*
**a^=*b;*
*printf(after%d%d,*a,*b);*
*return 0;*
*}*
*
*
*This swaps pointers *
On Sun, Jul 31, 2011 at 7:15 PM, Nikhil Gupta
Whats the logic behind
**a^=*b;*
**b^=*a;*
**a^=*b;*
??
On Sun, Jul 31, 2011 at 7:19 PM, rajeev bharshetty rajeevr...@gmail.comwrote:
*#includestdio.h*
*int main()*
*{*
*int i=10;*
*int j=20;*
*int *a,*b;*
*a =i;*
*b=j;*
*printf(before%d%d\n,*a,*b);*
**a^=*b;*
**b^=*a;*
**a^=*b;*
-- Forwarded message --
From: Harish Ravichandran chillwithh...@gmail.com
Date: Sun, Jul 31, 2011 at 4:23 PM
Subject: how 2 solve.
To: mitcse08i...@googlegroups.com, mit_cod...@googlegroups.com,
algogeeksforge...@googlegroups.com
In a chessboard the initial and final
http://ideone.com/YHxVe
@Rajeev, check this.
On Sun, Jul 31, 2011 at 7:28 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote:
Whats the logic behind
**a^=*b;*
**b^=*a;*
**a^=*b;*
??
On Sun, Jul 31, 2011 at 7:19 PM, rajeev bharshetty
rajeevr...@gmail.comwrote:
*#includestdio.h*
*int
suppose if we want to swap 3 and 5
*a=3
*b=5
then,
1st xoring *a and *b and copying back to *a *a=011
*b=101
*a=110
2nd-- *b^=^a --- *b=101
The c code as amol had suggested.
http://www.ideone.com/GP7O8
On Sun, Jul 31, 2011 at 6:55 PM, saurabh modi
saurabhmodi102...@gmail.comwrote:
you can read up the
http://en.wikipedia.org/wiki/Negative_base#Calculationpart on the wiki page
http://en.wikipedia.org/wiki/Negative_base
its
1 - 100 of 168 matches
Mail list logo