Re: [algogeeks] Adobe ques

2011-07-21 Thread sagar pareek
@anika first divide ur 32 bits in four octets then convert them in integers and save in 4 int variables now to find us system is little or big endian:- so u can do this as:- #includestdio.h union endian { int a; //assuming int to be 2 bytes char [2]; }; main() { union a ={1};

Re: [algogeeks] Adobe ques

2011-07-21 Thread Anika Jain
@piyush: lets say 323 bit integer given is the one with its binary as 1110 00011000 0101 00110011 then output shall be 14.24.65.51 both for little as well as big endian.. On Thu, Jul 21, 2011 at 1:28 PM, sagar pareek sagarpar...@gmail.com wrote: @anika first divide ur 32 bits in four

Re: [algogeeks] Adobe ques

2011-07-21 Thread Anika Jain
sorry its 32 bit no. not 323..wrote tht by mistake On Thu, Jul 21, 2011 at 1:57 PM, Anika Jain anika.jai...@gmail.com wrote: @piyush: lets say 323 bit integer given is the one with its binary as 1110 00011000 0101 00110011 then output shall be 14.24.65.51 both for little as well as

Re: [algogeeks] Adobe ques

2011-07-21 Thread Piyush Sinha
http://www.ideone.com/4Rq51 -- *Piyush Sinha* *IIIT, Allahabad* *+91-7483122727* * https://www.facebook.com/profile.php?id=10655377926 NEVER SAY NEVER * -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

Re: [algogeeks] Adobe ques

2011-07-21 Thread Anika Jain
thanx all :) On Thu, Jul 21, 2011 at 2:26 PM, Piyush Sinha ecstasy.piy...@gmail.comwrote: http://www.ideone.com/4Rq51 -- *Piyush Sinha* *IIIT, Allahabad* *+91-7483122727* * https://www.facebook.com/profile.php?id=10655377926 NEVER SAY NEVER * -- You received this message

[algogeeks] Adobe Ques

2011-07-21 Thread Abhi
Given a string, find largest unique substring in string efficiently.. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/dOfxYROYaXEJ. To post to this group,

Re: [algogeeks] Adobe ques

2011-07-21 Thread Abhi
@piyush A small mistake though,but output of your code for 1110 00011000 0101 00110011 then output shall be 51.65.24.14 ..opposite of what should be -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web

[algogeeks] Adobe ques

2011-07-20 Thread Anika Jain
write a c code that takes a 32 bit ip address n prints it in dotted notation as a.b.c.d. The code shall work for big endian as well as for little endian.. In this how can i make it common for big endian and little endian?? if in little endian my lower order 8 bits shall be d but for big endian

Re: [algogeeks] Adobe ques

2011-07-20 Thread Piyush Sinha
@Anika..can u give one example?? On 7/21/11, Anika Jain anika.jai...@gmail.com wrote: write a c code that takes a 32 bit ip address n prints it in dotted notation as a.b.c.d. The code shall work for big endian as well as for little endian.. In this how can i make it common for big endian

[algogeeks] Adobe Ques

2010-07-14 Thread ankit mahendru
Write the code to print combinations of a given array (n r were given) e.g for abcde .r=3 ...print abc, bcd' cde etc -- 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

Re: [algogeeks] Adobe Ques

2010-07-14 Thread Ashish Goel
for (int i=0;in-r+1;i++) printf(%c%c%c , a[i],a[i+1],a[i+2]); Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Wed, Jul 14, 2010 at 6:23 PM, ankit mahendru ankit.mahend...@gmail.comwrote: Write the code to print combinations of a given array (n

Re: [algogeeks] Adobe Ques

2010-07-14 Thread ashita dadlani
@ashish:yours is not a generalized solution.Here you are assuming that u know r=3. What if we need to generalize the solution? On Wed, Jul 14, 2010 at 11:58 PM, Ashish Goel ashg...@gmail.com wrote: for (int i=0;in-r+1;i++) printf(%c%c%c , a[i],a[i+1],a[i+2]); Best Regards Ashish Goel

Re: [algogeeks] Adobe Ques

2010-07-14 Thread Anand
main() { char arr[]=abcde; int r = 3,i,count; int len; len = sizeof(arr)/sizeof(arr[0]); for(i=0;ilen-r;i++) { count = 0; while(count r) { printf(%c\t, arr[i+count]); count++; } printf(\t\t); } } http://codepad.org/3n1qdS2R On Wed, Jul 14, 2010 at