The answer is single queue...
If we fill the queue fully and then dequeue and try again to enqueue... We
will get the error.. This is because when we dequeue,we move the front
pointer of the queue but not the rear pointer.. But enqueue is at rear
end.. The condition for enqueue also checks the
*
*
*#include fstream
#include iostream
using namespace std;
bool flag=false;
void check(int i)
{
int sum=0;
char n[5];
itoa(i,n,10);
for(int j=0;j5 n[j] != '\0';j++)
{
char p = n[j];
sum += atoi(p);
}
if(sum==3 || sum==6 || sum==9)
flag = true;
else if(sum9)
check(sum);
}
void main()
{
int i;
int a,b,max,min;
max=(a+b+abs(a-b))/2;
min=(a+b-abs(a-b))/2;
--
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 unsubscribe from this group, send email to
It will work...
a=3
b=-2
max=(a+b+abs(a-b))/2
so
max=(3-2+abs(3-(-2)))/2
=(1+abs(5))/2
=(1+5)/2
=3
Same in case of min
--
cheers
priyanka
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send
wat about a double ended queue?
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 unsubscribe from this group, send email to
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
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