Write C code to implement level order traversal of a tree.
--
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
apply BFS
--
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
int mul(int a, int b)
{
int r=0;
if (a==0|| b==0)
r=0;
else
{
for(int i=0;ib;i++)
r=r+a;
}
return r;
}
On Wed, Jun 27, 2012 at 10:46 AM, Prateek Jain prateek10011...@gmail.comwrote:
main(a,b,m)
02{
03while (~scanf(%d%d,a,b))
04{
05 m=0;
06 while (a)
07
It can be done using Queues in O(n).
--
Amitesh
On Wed, Jun 27, 2012 at 3:07 PM, hary rathor harry.rat...@gmail.com wrote:
apply BFS
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
queue q;
q.enqueue(root);
while q is not empty
do
print :temp=dequeue();
if(temp-left)
enqueue(temp-left)
if(temp-right)
enqueue(temp-right);
end while;
On Wed, Jun 27, 2012 at 2:59 PM, Gobind Kumar Hembram
gobind@gmail.comwrote:
Write C code to
How to multiply two numbers without using * operator?
Hint:Use bit operators
--
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
search for Ethiopian Multiplication
On Wed, Jun 27, 2012 at 9:45 AM, Gobind Kumar Hembram
gobind@gmail.comwrote:
How to multiply two numbers without using * operator?
Hint:Use bit operators
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
main(a,b,m)
02{
03while (~scanf(%d%d,a,b))
04{
05 m=0;
06 while (a)
07 {
08if (a1)
09 m+=b;
10a=1;
11b=1;
12 }
13 printf(%d\n,m);
14}
15}
--
You received this message