Re: [algogeeks] Divide 2 nos. without DIVISON

2011-05-23 Thread ankit sambyal
here is the working code  :

#include
 8: int dividend, divisor, remainder;
 9:
10: /* Division function Computes the quotient and remainder of two numbers
11: using bit shifting */
12: int division(int tempdividend, int tempdivisor) {
13:
14: int quotient = 1;
15:
16: if (tempdivisor == tempdividend) {
17:remainder = 0;
18:return 1;
19: } else if (tempdividend < tempdivisor) {
20:remainder = tempdividend;
21:return 0;
22: }
23:
24: while (tempdivisor <= tempdividend) {
25:/* Here divisor <>
26:   divisor and quotient */
27:tempdivisor = tempdivisor << 1;
28:quotient = quotient << 1;
29: }
30:
31: /* We have reached the point where divisor > dividend,
32: therefore divide divisor and quotient by two */
33: tempdivisor = tempdivisor >> 1;
34: quotient = quotient >> 1;
35:
36: /* Call division recursively for the difference to get the
37: exact quotient */
38: quotient = quotient + division(tempdividend - tempdivisor, divisor);
39:
40: return quotient;
41: }
42:
43: /* Division of two numbers without using division operator */
44: void main() {
45:
46:  printf ("\nEnter the Dividend: ");
47:  scanf("%d", ÷nd);
48:  printf("\nEnter the Divisor: ");
49:  scanf("%d", &divisor);
50:
51:  printf("\n%d / %d: quotient = %d", dividend, divisor,
division(dividend, divisor));
52:  printf("\n%d / %d: remainder = %d", dividend, divisor, remainder);
53:  getch();
54: }


On Sat, May 21, 2011 at 11:40 PM, punnu  wrote:

> Given 2 nos.  we need to divide them without performing divison.
> Please give a better solution than subtracting the nos. again and
> again.
>
> --
> 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 group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] [brain teaser ] Murder mystery puzzle 23 may

2011-05-23 Thread Lavesh Rawat
*Murder mystery puzzle
 *
*
*
**
*Two cops walked into a room with no windows and found a dead man who
obviously hung himself from the ceiling, though they couldn't figure out
how. There was no chair beneath him that he might have jumped off of, or a
table. Just a puddle of water. How'd he do it
*

*Update Your Answers at* : Click
Here


Solution:
Will be updated after 1 day



-- 

"Never explain yourself. Your friends don’t need it and
your enemies won’t believe 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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] [brain teaser ] Murder mystery puzzle 23 may

2011-05-23 Thread Naveen Kumar
He must be standing on a ice block. :)

On Mon, May 23, 2011 at 1:57 PM, Lavesh Rawat wrote:

> *Murder mystery puzzle
>  *
> *
> *
> **
> *Two cops walked into a room with no windows and found a dead man who
> obviously hung himself from the ceiling, though they couldn't figure out
> how. There was no chair beneath him that he might have jumped off of, or a
> table. Just a puddle of water. How'd he do it
> *
>
> *Update Your Answers at* : Click 
> Here
>
>
> Solution:
> Will be updated after 1 day
>
>
>
> --
>
> "Never explain yourself. Your friends don’t need it and
> your enemies won’t believe 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Cheers
Naveen Kumar

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] I teach IT-related Courses

2011-05-23 Thread Geo News
*Study Online For Diploma
Study at Your Own Time & Own Pace Globally Recognized Diploma Courses
http://bit.ly/khS0GB

http://bit.ly/khS0GB

http://bit.ly/khS0GB
*
-- 
If you would like to get daily pictures
We've started a Google Group to allow our visitors to get daily funny and
Crazy Pictures , You can join this group for free , go to...
*http://groups.google.com/group/WomenForum/subscribe*

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Spoj Problem Help

2011-05-23 Thread Akshata Sharma
@tec: the sequence should be like (0,1),(1,1),(1,2),(2,3),(3,5),(5,8)... or
m i wrong?

On Mon, May 23, 2011 at 11:08 AM, Aakash Johari wrote:

> Matrix exponentiation can help i think
>
> On Sun, May 22, 2011 at 10:36 PM, Akshata Sharma <
> akshatasharm...@gmail.com> wrote:
>
>> It appers that the problem is just to find the (N+3)th fibonacci number
>> for given N. Since N is very large, how to find nth fibonaci number for such
>> a large n??
>>
>> On Mon, May 23, 2011 at 7:51 AM, tec  wrote:
>>
>>> Try thinking backwards.
>>> (0,1),(1,2),(2,3),(3,5),(5,8),(8,13),...
>>>
>>> 2011/5/22 shady :
>>> > Hey,
>>> > Can anyone tell how to solve this problem in Spoj ? I went through
>>> > some material but there all they were discussing was on complexity and
>>> > not on actual number of iterations.
>>> > http://www.spoj.pl/problems/MAIN74/
>>> >
>>> > Thanks.
>>> >
>>> > --
>>> > 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 group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>> >
>>> >
>>>
>>>
>>>
>>> --
>>> __
>>>
>>> --
>>> 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 group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>>
>>  --
>> 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 group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> -Aakash Johari
> (IIIT Allahabad)
>
>
>
>
>  --
> 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 group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Another SPOJ Problem -SIGSEGV -- Need Help

2011-05-23 Thread Dumanshu
In this problem u have to write a code(interested in a C code)  which
will cause a segmentation fault. Now the trick is to write the code as
short as possible. Your score is the no. of characters in the code.
Less the no. of characters, Better the score(rank).

I wrote a code something like this :

main(int*a){*a=3;}

its 18chars.
But the best solution in C is 5 characters. Does this mean it is
possible to answer this quesion without using a main() function
because main() itself is 6 chars?
Is it possible to compile and run a .c file which doesn't have a
main() function and cause runtime seg fault?
Any help would be greatly appreciated.

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Facebook Interview Question from glassdoor

2011-05-23 Thread Dumanshu
Given a telephone number, find all the permutations of the letters
assuming 1=abc, 2=def, etc.

given solution(probable)  :Standard "find all permutations" of XYZ,
except for each XYZ, you include permutations for each X0...Xn,
Y0...Yn, etc

Does this example satisfy everything being asked?

eg. telephone number be 12

so total no. of permutations are (no. of permutations of abc) x (no.
of permutations of def)


any decent way to generate all the permutations?

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Facebook Interview Question from glassdoor

2011-05-23 Thread anshu mishra
for 12 answer will be 36? is it ur question?

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Facebook Interview Question from glassdoor

2011-05-23 Thread Dumanshu
I didn't get the question actually. I have copied the post(the
question). but i dont think for 12, 36 can be the answer. We have to
go for the permutation of the telephone number i guess after
substituting for each number the corresponding set of alphabets.
The question given is - "Given a telephone number, find all the
permutations of the letters
assuming 1=abc, 2=def, etc."

and the solution given is - Standard "find all permutations" of XYZ,
except for each XYZ, you include permutations for each X0...Xn,
Y0...Yn, etc



On May 23, 5:51 pm, anshu mishra  wrote:
> for 12 answer will be 36? is it ur question?

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: GOOGLE Q

2011-05-23 Thread bittu
Study Trie & Then Apply It..It Will Work
PS: We already have dictionary congaing all the possible words if its
not given then we can make the dictionary & then we can find out the
all possible anagram of word in constant time O(K) where K is length
of each anagram of word W.


Hope i m correct


Thanks
Shashank>> " The Best Way to Escape From The Problem is to Solve It"
CSE,BIT Mesra

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Divide 2 nos. without DIVISON

2011-05-23 Thread bittu
I don't know u will be happy with this or not but let me explain in
simplest way
PS: i haven't used division operator anywhere but i also i haven't
done using Bit Logic  which is efficient then this one but below code
work & simplest way to understand


This One is the Simply Logical. This will work all kind of Inputs. The
concept behind this is We need to Perform the Reverse Operation
performed on the Mutiplication Without '*' Opreator. Here we need to
Subtract the Second Number From the First Number Until First Number >=
Second Number. That’s All.

For example, Assume that a=10, b=3. Here we need to do is Subtract the
Number 3 from the number 10 itself, until a>=b. And we should make a
count for how many times we are doing like this, It is the Quotient
Value.

So, finally We get the Answer as 3 Times we subtract 3 from the Number
10. Because we are checking the Condition a>=b everytime. So the is
the Quotient as 3. The Remainder will be stored itself in 'a' as 1.




#include
#include

void main()
{
int a,b,c;
clrscr();

printf("Enter 2 No.s :\n");
scanf("%d%d",&a,&b); // Read 2 Numbers

if(b==0) // Here we are Checking for the Divide By Zero Error
{
printf("\nDivide By Zero Error");
}

else
{
c=0; // Here c as Count, and we should initialize the Count value to
0.
while(a>=b) // We Repeatedly Checking for the Condition a>=b
{
a = a - b; // Subtract b from a, and the new result stored in 'a'
itself
c++; // Incrementing the Count
}

printf("\nQuotient = %d \n Remainder = %d",c,a); // Print Quotient and
Remainder
}

getch();
}


Thanks
Shashank>>"The Best Way To Escape From The Problem  is to Solve It"
CSE,BIT Mesra

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Spoj Problem Help

2011-05-23 Thread sravanreddy001
@akshata,
The (1,1) would be a special case.
for give N=1, but again for N=1, (2,1) also satisfies well.
And the series from then is constructed on the  (1,0), (2,1), (3,2) So and 
so.. 
Also if you see in the original problem statement, they mentioned a>=b, but 
not a>b..
this is for the special case, i.e, for N=1, the return value is 2 (1+1) and 
for other N value
its ( fib(N+3) + fib(N+2) ) 
 
@akash.. can you please point me to the matrix exponentiation method? I've 
no idea on this for this prob..
 

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Spoj Problem Help

2011-05-23 Thread sravanreddy001
There is also another special case..  where N=0, in this case.. its (0,0) 
--> 0+0 = 0
 

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Application of Data Structure In Moview]

2011-05-23 Thread bittu
 I think Hash-map With Separate Chaining Will be Best Where Key Will
be Name of country & value will be pointer to linked list that will
hold all the scene Shooted in that country so hope it pretty clear
that as we shooting scene randomly so whenever new scene Shooted put
into bucket of Hash-map if starting pointer of linked is null else if
scene from same country repeats again then add it to last or first its
can be done O(1) & repeat the same for remaining scene so when
particular scene will be displayed just display it & increment the
corresponding pointer of bucket ..It just an approach we have to take
care of out system requirement & complexity Issue (time & space) so in
this case whenever collision occur string an item can be done in O(1)
but retrying the item may take the time of length of linked list in
particular bucket O(n)

See There are several DS & several way we can do insertion ,
searching, deletion operation in O(1) but not all of the same time but
here is problem is that of associativity i mean every scene is
associated with particular country

Correct me if anything Wrong or Optimization or Suggest Any DS.that
can perform both operation very fast ??

Thanks
Shashank>>"The Best Way to Escape From The Problem is to Solve It"
CSE,BIT Mesra
Reach Me:+91- 9739002481

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Facebook Interview Question from glassdoor

2011-05-23 Thread anshu mishra
the same question i have asked in microsoft interview. (if it is the same
:P)

for 12 perutation are (ad, ae, af, bd, be, bf, cd, ce ,cf);
i have given them 3 solution(recusrsive, stack based) and the last one what
they wanted.

take a tertiary number(n) = 3^(number of digits) in case of 12 it is equals
to 2;

i m solving the save problem. assuming on every key there are only 2
alphabets.

char c[][2] = {ab , cd, ..};

char n[] = 2156169 (number is pressed);
so k = 7;
for (i = 0; i < (1

Re: [algogeeks] Spoj Problem Help

2011-05-23 Thread anshu mishra
@sravanreddy001
suppose u have to calulate A^n u can calculate in O(d^3*log(n));
d is dimesion of matrixl
while (n)
{
if (n&1) mul(ans, A, d);
mul(A, A, d);
n >>=1;
}


-- 
Anshuman Mishra
IIIT Allahabad
-

anshumishra6...@gmail.com
rit2007...@iiita.ac.in

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Good opportunity for Salesforce.com Developer in Columbus, OH

2011-05-23 Thread sohail panzer
Dear Professional,
Hope you are doing well.
I am a technical recruiter with Panzer Solutions LLC Software Implementing
and IT consulting company located in CT. Please go through the Job
Description and send me your updated resume with contact information.

*Please reply at soh...@panzersolutions.com*

Title  :   Salesforce.com Developer
Location   :   Columbus, OH
Duration  :   2 years contract
MUST ME A US CITIZEN OR EAD OR GREENCARD HOLDER.


Requirements
Seasoned Developer with:
1+ years experience as with Salesforce.com Development, Architecture, Design
and Support
Good Personality
Visualforce
Apex

Plusses
Certs/Degree

Responsibilities
This position requires the ability to lead the design, architecture,
development and going support for the SalesForce.com CRM solution. The
candidate must have hands on experience with SalesForce.com. Ability to
mentor technical team members on the process and deliver excellent
presentation, technical design, and architecture documentation. Work with
business representatives, business analysts to quickly understand
requirements. Evaluate, select, implement, and integrate technology tools
into a client solution. .



Thank you,

Sohail Khan | Technical Recruiter
Panzer Solutions LLc
45 Stuart Ave, K
Norwalk, CT 06850 USA
Voice: 203-813-2052
soh...@panzersolutions.com
URL: www.panzersolutions.com

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Another SPOJ Problem -SIGSEGV -- Need Help

2011-05-23 Thread kumar anurag
can you tell me the problem? or link?

On Mon, May 23, 2011 at 6:09 PM, Dumanshu  wrote:

> In this problem u have to write a code(interested in a C code)  which
> will cause a segmentation fault. Now the trick is to write the code as
> short as possible. Your score is the no. of characters in the code.
> Less the no. of characters, Better the score(rank).
>
> I wrote a code something like this :
>
> main(int*a){*a=3;}
>
> its 18chars.
> But the best solution in C is 5 characters. Does this mean it is
> possible to answer this quesion without using a main() function
> because main() itself is 6 chars?
> Is it possible to compile and run a .c file which doesn't have a
> main() function and cause runtime seg fault?
> Any help would be greatly appreciated.
>
> --
> 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 group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
Kumar Anurag

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Another SPOJ Problem -SIGSEGV -- Need Help

2011-05-23 Thread saurabh singh
Using the asm construct of c..
Though i did this problem in native asm and my solution is 3 char ;)...
The point is you  have to know if not proficient with NASM(Net Assembler
used by SPOJ)...
If you need the solution mail me.

-- 
Saurabh Singh
B.Tech (Computer Science)
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 algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Another SPOJ Problem -SIGSEGV -- Need Help

2011-05-23 Thread saurabh singh
http://www.spoj.pl/problems/SIGSEGV/

On Mon, May 23, 2011 at 7:52 PM, kumar anurag wrote:

> can you tell me the problem? or link?
>
>
> On Mon, May 23, 2011 at 6:09 PM, Dumanshu  wrote:
>
>> In this problem u have to write a code(interested in a C code)  which
>> will cause a segmentation fault. Now the trick is to write the code as
>> short as possible. Your score is the no. of characters in the code.
>> Less the no. of characters, Better the score(rank).
>>
>> I wrote a code something like this :
>>
>> main(int*a){*a=3;}
>>
>> its 18chars.
>> But the best solution in C is 5 characters. Does this mean it is
>> possible to answer this quesion without using a main() function
>> because main() itself is 6 chars?
>> Is it possible to compile and run a .c file which doesn't have a
>> main() function and cause runtime seg fault?
>> Any help would be greatly appreciated.
>>
>> --
>> 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 group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>
>
> --
> Kumar Anurag
>
>  --
> 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 group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Saurabh Singh
B.Tech (Computer Science)
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 algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Another SPOJ Problem -SIGSEGV -- Need Help

2011-05-23 Thread kumar anurag
can you post the problem link?

On Mon, May 23, 2011 at 7:53 PM, saurabh singh  wrote:

>
> Using the asm construct of c..
> Though i did this problem in native asm and my solution is 3 char ;)...
> The point is you  have to know if not proficient with NASM(Net Assembler
> used by SPOJ)...
> If you need the solution mail me.
>
> --
> Saurabh Singh
> B.Tech (Computer Science)
> 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 algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Kumar Anurag

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Spoj Problem Help

2011-05-23 Thread Akshata Sharma
@sravanreddy001
by matrix exponential method, we can calculate the nth fibonacci number in
logarithmic time.

On Mon, May 23, 2011 at 7:39 PM, anshu mishra wrote:

> @sravanreddy001
> suppose u have to calulate A^n u can calculate in O(d^3*log(n));
> d is dimesion of matrixl
> while (n)
> {
> if (n&1) mul(ans, A, d);
> mul(A, A, d);
> n >>=1;
> }
>
>
> --
> Anshuman Mishra
> IIIT Allahabad
> -
>
> anshumishra6...@gmail.com
> rit2007...@iiita.ac.in
>
>  --
> 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 group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Divide 2 nos. without DIVISON

2011-05-23 Thread sravanreddy001
@bittu..
 Given 2 nos.  we need to divide them without performing divison. 
*Please give a better solution than subtracting the nos. again and 
again.*
The author has specifically mentioned this.
The order of this algo will be log(n) since the numbers are represented in 
binary form.
against log(n), where the Quotient =~ N
 
** 

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] ADF Senior Developer -- Miami, FL -- 6+ months contract

2011-05-23 Thread sohail panzer
Dear Professional,
Hope you are doing well.
I am a technical recruiter with Panzer Solutions LLC Software Implementing
and IT consulting company located in CT. Please go through the Job
Description and send me your updated resume with contact information.
*
Please reply at soh...@panzersolutions.com
*
Title  :ADF Senior Developer
Location   :Miami, FL
Duration  :6+ months contract


Key Responsibilities
Design, Implement and Test Oracle ADF applications using JDeveloper 11g
Document installation and troubleshooting procedures
Propose design, development and administration best practices
Conduct analysis of customer collaboration requirements and make
recommendations for improvements based on past experiences
Design and document the technical solution balancing short term timelines
with long term supportability and maintainability
Construct and unit test the technical solution
Participate in additional QA cycles quickly turning-around identified
defects

Experience
2-3 years of relevant work experience with the Oracle Fusion middleware
products, specifically the ADF Suite 10g/11g including the JDeveloper IDE
and integration with PL/SQL applications
3-5 year of experience developing Java/J2EE applications using Struts, JSF
for the UI and EJBs, Hibernate, or iBatis strongly preferred
3-5 years relevant work experience with Oracle Applications,
3-5 years of Oracle's SOA Suite development experience is a plus
BEA WebLogic J2EE Application server platform experience is preferred




Thank you,

Sohail Khan | Technical Recruiter
Panzer Solutions LLc
45 Stuart Ave, K
Norwalk, CT 06850 USA
Voice: 203-813-2052
soh...@panzersolutions.com
URL: www.panzersolutions.com

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Spoj Problem Help

2011-05-23 Thread Aakash Johari
@akshata, sravanreddy: yes, for more info regarding matrix expo. you can go
through http://zobayer.blogspot.com/2010/11/matrix-exponentiation.html

On Mon, May 23, 2011 at 7:28 AM, Akshata Sharma
wrote:

> @sravanreddy001
> by matrix exponential method, we can calculate the nth fibonacci number in
> logarithmic time.
>
>
> On Mon, May 23, 2011 at 7:39 PM, anshu mishra 
> wrote:
>
>> @sravanreddy001
>> suppose u have to calulate A^n u can calculate in O(d^3*log(n));
>> d is dimesion of matrixl
>> while (n)
>> {
>> if (n&1) mul(ans, A, d);
>> mul(A, A, d);
>> n >>=1;
>> }
>>
>>
>> --
>> Anshuman Mishra
>> IIIT Allahabad
>> -
>>
>> anshumishra6...@gmail.com
>> rit2007...@iiita.ac.in
>>
>>  --
>> 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 group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> 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 group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
-Aakash Johari
(IIIT Allahabad)

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Facebook Interview Question from glassdoor

2011-05-23 Thread immanuel kingston
Extending the above soln:

NUM_PER_DIGIT = 3
char c[][NUM_PER_DIGIT] = {"abc","def",...};
char n[] = 2156169 (number is pressed);
int k=7;

for i <-- 0 to  NUM_PER_DIGIT ^ k
String s="";
for j <-- 0 to k
int index = getJthDigitinItotheBaseNumPerDigit(NUM_PER_DIGIT,i,j);
// ie get 1st digit in (022)3 returns 2
s += c[n[j]][index];
print(s);


Time Complexity: O((NUM_PER_DIGIT^k)*k^2);

On Mon, May 23, 2011 at 7:32 PM, anshu mishra wrote:

> the same question i have asked in microsoft interview. (if it is the same
> :P)
>
> for 12 perutation are (ad, ae, af, bd, be, bf, cd, ce ,cf);
> i have given them 3 solution(recusrsive, stack based) and the last one what
> they wanted.
>
> take a tertiary number(n) = 3^(number of digits) in case of 12 it is equals
> to 2;
>
> i m solving the save problem. assuming on every key there are only 2
> alphabets.
>
> char c[][2] = {ab , cd, ..};
>
> char n[] = 2156169 (number is pressed);
> so k = 7;
> for (i = 0; i < (1< string s = "";
>  for (j = 0; j < k; j++){
>  s += c[n[j]][i & (1< }
> print(s);
> }
>
> same logic u can use for tertiary too.
>
>  --
> 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 group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Facebook Interview Question from glassdoor

2011-05-23 Thread immanuel kingston
A Recursive soln:

NUM_PER_DIGIT = 3
char c[][NUM_PER_DIGIT] = {"abc","def",...};

char n[] = 2156169 (number is pressed);
int k=7;
char * s = (char *) malloc(sizeof(char) * k);

void printAllCombinations (char c[][], char n[], int k, char *s, int count)
{
if (count >= k - 1) {
s[k] = '\0';
print (s);
} else {
for (i =0; i< NUM_PER_DIGIT; i++) {
s[i] = c[count][i];
printAllCombinations(c,n,k,s, count+1);
}
}
}
printAllCombinations (c,n,k,s,0);

Please correct me if my understanding is wrong.

Thanks,
Immanuel

On Mon, May 23, 2011 at 9:33 PM, immanuel kingston <
kingston.imman...@gmail.com> wrote:

> Extending the above soln:
>
> NUM_PER_DIGIT = 3
> char c[][NUM_PER_DIGIT] = {"abc","def",...};
>
> char n[] = 2156169 (number is pressed);
> int k=7;
>
> for i <-- 0 to  NUM_PER_DIGIT ^ k
> String s="";
> for j <-- 0 to k
> int index = getJthDigitinItotheBaseNumPerDigit(NUM_PER_DIGIT,i,j);
> // ie get 1st digit in (022)3 returns 2
> s += c[n[j]][index];
> print(s);
>
>
> Time Complexity: O((NUM_PER_DIGIT^k)*k^2);
>
>
> On Mon, May 23, 2011 at 7:32 PM, anshu mishra 
> wrote:
>
>> the same question i have asked in microsoft interview. (if it is the same
>> :P)
>>
>> for 12 perutation are (ad, ae, af, bd, be, bf, cd, ce ,cf);
>> i have given them 3 solution(recusrsive, stack based) and the last one
>> what they wanted.
>>
>> take a tertiary number(n) = 3^(number of digits) in case of 12 it is
>> equals to 2;
>>
>> i m solving the save problem. assuming on every key there are only 2
>> alphabets.
>>
>> char c[][2] = {ab , cd, ..};
>>
>> char n[] = 2156169 (number is pressed);
>> so k = 7;
>> for (i = 0; i < (1<> string s = "";
>>  for (j = 0; j < k; j++){
>>  s += c[n[j]][i & (1<> }
>> print(s);
>> }
>>
>> same logic u can use for tertiary too.
>>
>>  --
>> 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 group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Facebook Interview Question from glassdoor

2011-05-23 Thread immanuel kingston
small correction

On Mon, May 23, 2011 at 9:46 PM, immanuel kingston <
kingston.imman...@gmail.com> wrote:

> A Recursive soln:
>
>
> NUM_PER_DIGIT = 3
> char c[][NUM_PER_DIGIT] = {"abc","def",...};
>
> char n[] = 2156169 (number is pressed);
> int k=7;
> char * s = (char *) malloc(sizeof(char) * k);
>
> void printAllCombinations (char c[][], char n[], int k, char *s, int count)
> {
> if (count >= k - 1) {
> s[k] = '\0';
> print (s);
> } else {
> for (i =0; i< NUM_PER_DIGIT; i++) {
> *s[i] = c[n[count]][i];*
> printAllCombinations(c,n,k,s, count+1);
> }
> }
> }
> printAllCombinations (c,n,k,s,0);
>
> Please correct me if my understanding is wrong.
>
> Thanks,
> Immanuel
>
>
> On Mon, May 23, 2011 at 9:33 PM, immanuel kingston <
> kingston.imman...@gmail.com> wrote:
>
>> Extending the above soln:
>>
>> NUM_PER_DIGIT = 3
>> char c[][NUM_PER_DIGIT] = {"abc","def",...};
>>
>> char n[] = 2156169 (number is pressed);
>> int k=7;
>>
>> for i <-- 0 to  NUM_PER_DIGIT ^ k
>> String s="";
>> for j <-- 0 to k
>> int index = getJthDigitinItotheBaseNumPerDigit(NUM_PER_DIGIT,i,j);
>> // ie get 1st digit in (022)3 returns 2
>> s += c[n[j]][index];
>> print(s);
>>
>>
>> Time Complexity: O((NUM_PER_DIGIT^k)*k^2);
>>
>>
>> On Mon, May 23, 2011 at 7:32 PM, anshu mishra 
>> wrote:
>>
>>> the same question i have asked in microsoft interview. (if it is the same
>>> :P)
>>>
>>> for 12 perutation are (ad, ae, af, bd, be, bf, cd, ce ,cf);
>>> i have given them 3 solution(recusrsive, stack based) and the last one
>>> what they wanted.
>>>
>>> take a tertiary number(n) = 3^(number of digits) in case of 12 it is
>>> equals to 2;
>>>
>>> i m solving the save problem. assuming on every key there are only 2
>>> alphabets.
>>>
>>> char c[][2] = {ab , cd, ..};
>>>
>>> char n[] = 2156169 (number is pressed);
>>> so k = 7;
>>> for (i = 0; i < (1<>> string s = "";
>>>  for (j = 0; j < k; j++){
>>>  s += c[n[j]][i & (1<>> }
>>> print(s);
>>> }
>>>
>>> same logic u can use for tertiary too.
>>>
>>>  --
>>> 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 group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Are you looking for JAVA developer position in Brentwood, TN

2011-05-23 Thread sohail panzer
Dear Professional,
Hope you are doing well.
I am a technical recruiter with Panzer Solutions LLC Software Implementing
and IT consulting company located in CT. Please go through the Job
Description and send me your updated resume with contact information.
*
*
*Please reply at soh...@panzersolutions.com
*
Title  :JAVA developer
Location   :Brentwood, TN
Duration  :6 months contract
Locals are highly preferred
Rate  :$40 hr on C2C or 1099


*Must Have*:
5 years developing JAVA
3 years of working in a websphere environment

*Plus:*
Local to Nashville/ Tennessee

*Responsibility
*Modifying existing code and creating new software.  Any transaction based
experience would be great!


Thank you,

Sohail Khan | Technical Recruiter
Panzer Solutions LLc
45 Stuart Ave, K
Norwalk, CT 06850 USA
Voice: 203-813-2052
soh...@panzersolutions.com
URL: www.panzersolutions.com

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] hot list

2011-05-23 Thread upendar sannaila
Hello



My name is Upendar and I am a sales recruiter at Oberon IT Inc. please add
upen...@oberonit.com and keep sending me the requirements….





* *

*Consultant Name  Technology
Experience   Relocation   *

**

*1. Hari  Informatica
Developer  8+Open*

**

*2. Swarna QA
7+Only in TX*

**

*3. NarasimhaSQL DBA
8+Open*

**

*4. Ashwin Weblogic
Administrator   7+ Open*

*5. SriWeblogic
Administrator   8+ Open*

**

**

*6. Devi Business
analyst  6+ Open*

**

*7. Bhargav   WebSphere
Administrator7+Open*

**

**

*8. vilas SAS clinical
8+Open*

* *

*Thanks &  Regards*

*Upendar *

*Oberon IT, Inc *

*Email:  upen...@oberonit.com *

*Phone # 972- 853-8938*

*Fax: 800 218 2820*

*YM: upendar_obe...@ymail.com *

*GM:upendar.sa...@gmail.com*

*
* **

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Looking for RSA Archer Risk Management PM/BA -- Cleveland OH

2011-05-23 Thread sohail panzer
Dear Professional,
Hope you are doing well.
I am a technical recruiter with Panzer Solutions LLC Software Implementing
and IT consulting company located in CT. Please go through the Job
Description and send me your updated resume with contact information.
*
Please reply at soh...@panzersolutions.com
*
Title  :RSA Archer Risk Management PM/BA
Location   :Cleveland OH
Duration  :6 Month Contract (Possibilities of
extensions)
Rate  :$40 hr on C2C or 1099


MUST HAVES:
Experience with RSA Archer Risk Management (product implementation)
Project Management or Business Analyst experience
Has completed at least 1-2 RSA Archer implementation previously

PLUSES:
Financial experience

Responsibilites
This individual will be heading a team of 4-5 technical individuals leading
an implementation of RSA Archer Risk Management onsite in Cleaveland, OH.
This will be a 6 month contract with the possibilities of extensions and
must have implemented this product at least once before.  I know this is
extremely niche but if we can come through for them we will then be able to
staff every need for this huge multi-million dollar project.

 ** RSA Archer Risk Management enables to proactively address reputational,
financial, operational and IT risks against corporate objectives. This
web-based solution delivers a central management system for identifying
risks, evaluating their likelihood and impact, relating them to mitigating
controls and tracking their resolution. RSA Archer Risk Management allows to
manage a comprehensive Risk program enabled by a central risk repository
with project management capabilities, key risk indicators and loss events.**




Thank you,

Sohail Khan | Technical Recruiter
Panzer Solutions LLc
45 Stuart Ave, K
Norwalk, CT 06850 USA
Voice: 203-813-2052
soh...@panzersolutions.com
URL: www.panzersolutions.com

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Facebook Interview Question from glassdoor

2011-05-23 Thread anuj agarwal
Immanuel,
We can keep c and n arrays as global variable as they are not part of state
of the recursion.

Anuj Agarwal
Engineering is the art of making what you want from things you can get.


On Mon, May 23, 2011 at 10:04 PM, immanuel kingston <
kingston.imman...@gmail.com> wrote:

> small correction
>
> On Mon, May 23, 2011 at 9:46 PM, immanuel kingston <
> kingston.imman...@gmail.com> wrote:
>
>> A Recursive soln:
>>
>>
>> NUM_PER_DIGIT = 3
>> char c[][NUM_PER_DIGIT] = {"abc","def",...};
>>
>> char n[] = 2156169 (number is pressed);
>> int k=7;
>> char * s = (char *) malloc(sizeof(char) * k);
>>
>> void printAllCombinations (char c[][], char n[], int k, char *s, int
>> count) {
>> if (count >= k - 1) {
>> s[k] = '\0';
>> print (s);
>> } else {
>> for (i =0; i< NUM_PER_DIGIT; i++) {
>>  *s[i] = c[n[count]][i];*
>>
>> printAllCombinations(c,n,k,s, count+1);
>> }
>> }
>> }
>> printAllCombinations (c,n,k,s,0);
>>
>> Please correct me if my understanding is wrong.
>>
>> Thanks,
>> Immanuel
>>
>>
>> On Mon, May 23, 2011 at 9:33 PM, immanuel kingston <
>> kingston.imman...@gmail.com> wrote:
>>
>>> Extending the above soln:
>>>
>>> NUM_PER_DIGIT = 3
>>> char c[][NUM_PER_DIGIT] = {"abc","def",...};
>>>
>>> char n[] = 2156169 (number is pressed);
>>> int k=7;
>>>
>>> for i <-- 0 to  NUM_PER_DIGIT ^ k
>>> String s="";
>>> for j <-- 0 to k
>>> int index =
>>> getJthDigitinItotheBaseNumPerDigit(NUM_PER_DIGIT,i,j); // ie get 1st digit
>>> in (022)3 returns 2
>>> s += c[n[j]][index];
>>> print(s);
>>>
>>>
>>> Time Complexity: O((NUM_PER_DIGIT^k)*k^2);
>>>
>>>
>>> On Mon, May 23, 2011 at 7:32 PM, anshu mishra >> > wrote:
>>>
 the same question i have asked in microsoft interview. (if it is the
 same :P)

 for 12 perutation are (ad, ae, af, bd, be, bf, cd, ce ,cf);
 i have given them 3 solution(recusrsive, stack based) and the last one
 what they wanted.

 take a tertiary number(n) = 3^(number of digits) in case of 12 it is
 equals to 2;

 i m solving the save problem. assuming on every key there are only 2
 alphabets.

 char c[][2] = {ab , cd, ..};

 char n[] = 2156169 (number is pressed);
 so k = 7;
 for (i = 0; i < (1<>>> string s = "";
  for (j = 0; j < k; j++){
  s += c[n[j]][i & (1<>>> }
 print(s);
 }

 same logic u can use for tertiary too.

  --
 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 group at
 http://groups.google.com/group/algogeeks?hl=en.

>>>
>>>
>>
>  --
> 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 group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Facebook Interview Question from glassdoor

2011-05-23 Thread immanuel kingston
@Anuj, true.This will optimise the solution by reducing the amount of stack
space used for recursion.


NUM_PER_DIGIT = 3
char c[][NUM_PER_DIGIT] = {"abc","def",...};

char n[] = 2156169 (number is pressed);
int k=7;
char * s = (char *) malloc(sizeof(char) * k);

void printAllCombinations (int k, char *s, int count) {
if (count >= k - 1) {
s[k] = '\0';
print (s);
} else {
for (i =0; i< NUM_PER_DIGIT; i++) {
s[i] = c[n[count]][i];
printAllCombinations(k,s, count+1);
}
}
}
printAllCombinations (k,s,0);

Thanks,
Immanuel


On Mon, May 23, 2011 at 10:41 PM, anuj agarwal wrote:

> Immanuel,
> We can keep c and n arrays as global variable as they are not part of state
> of the recursion.
>
> Anuj Agarwal
> Engineering is the art of making what you want from things you can get.
>
>
>
> On Mon, May 23, 2011 at 10:04 PM, immanuel kingston <
> kingston.imman...@gmail.com> wrote:
>
>> small correction
>>
>> On Mon, May 23, 2011 at 9:46 PM, immanuel kingston <
>> kingston.imman...@gmail.com> wrote:
>>
>>> A Recursive soln:
>>>
>>>
>>> NUM_PER_DIGIT = 3
>>> char c[][NUM_PER_DIGIT] = {"abc","def",...};
>>>
>>> char n[] = 2156169 (number is pressed);
>>> int k=7;
>>> char * s = (char *) malloc(sizeof(char) * k);
>>>
>>> void printAllCombinations (char c[][], char n[], int k, char *s, int
>>> count) {
>>> if (count >= k - 1) {
>>> s[k] = '\0';
>>> print (s);
>>> } else {
>>> for (i =0; i< NUM_PER_DIGIT; i++) {
>>>  *s[i] = c[n[count]][i];*
>>>
>>> printAllCombinations(c,n,k,s, count+1);
>>> }
>>> }
>>> }
>>> printAllCombinations (c,n,k,s,0);
>>>
>>> Please correct me if my understanding is wrong.
>>>
>>> Thanks,
>>> Immanuel
>>>
>>>
>>> On Mon, May 23, 2011 at 9:33 PM, immanuel kingston <
>>> kingston.imman...@gmail.com> wrote:
>>>
 Extending the above soln:

 NUM_PER_DIGIT = 3
 char c[][NUM_PER_DIGIT] = {"abc","def",...};

 char n[] = 2156169 (number is pressed);
 int k=7;

 for i <-- 0 to  NUM_PER_DIGIT ^ k
 String s="";
 for j <-- 0 to k
 int index =
 getJthDigitinItotheBaseNumPerDigit(NUM_PER_DIGIT,i,j); // ie get 1st digit
 in (022)3 returns 2
 s += c[n[j]][index];
 print(s);


 Time Complexity: O((NUM_PER_DIGIT^k)*k^2);


 On Mon, May 23, 2011 at 7:32 PM, anshu mishra <
 anshumishra6...@gmail.com> wrote:

> the same question i have asked in microsoft interview. (if it is the
> same :P)
>
> for 12 perutation are (ad, ae, af, bd, be, bf, cd, ce ,cf);
> i have given them 3 solution(recusrsive, stack based) and the last one
> what they wanted.
>
> take a tertiary number(n) = 3^(number of digits) in case of 12 it is
> equals to 2;
>
> i m solving the save problem. assuming on every key there are only 2
> alphabets.
>
> char c[][2] = {ab , cd, ..};
>
> char n[] = 2156169 (number is pressed);
> so k = 7;
> for (i = 0; i < (1< string s = "";
>  for (j = 0; j < k; j++){
>  s += c[n[j]][i & (1< }
> print(s);
> }
>
> same logic u can use for tertiary too.
>
>  --
> 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 group at
> http://groups.google.com/group/algogeeks?hl=en.
>


>>>
>>  --
>> 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 group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> 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 group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Another SPOJ Problem -SIGSEGV -- Need Help

2011-05-23 Thread Dumanshu
I want to discuss the solution in C language. I want to test my file
using gcc compiler. For C the best solution is 5 chars. Any ideas
about that??

On May 23, 7:23 pm, saurabh singh  wrote:
> Using the asm construct of c..
> Though i did this problem in native asm and my solution is 3 char ;)...
> The point is you  have to know if not proficient with NASM(Net Assembler
> used by SPOJ)...
> If you need the solution mail me.
>
> --
> Saurabh Singh
> B.Tech (Computer Science)
> 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 algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks]

2011-05-23 Thread Piyush Sinha
Find whether the binary representation of a number is palindrome or
not. The input begins with integer N.
-- 
*Piyush Sinha*
*IIIT, Allahabad*
*+91-8792136657*
*+91-7483122727*
*https://www.facebook.com/profile.php?id=10655377926 *

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks]

2011-05-23 Thread Piyush Sinha
Constraint is no extra space and the complexity should be as efficient
as possible.

On 5/24/11, Piyush Sinha  wrote:
> Find whether the binary representation of a number is palindrome or
> not. The input begins with integer N.
> --
> *Piyush Sinha*
> *IIIT, Allahabad*
> *+91-8792136657*
> *+91-7483122727*
> *https://www.facebook.com/profile.php?id=10655377926 *
>
> --
> 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 group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
*Piyush Sinha*
*IIIT, Allahabad*
*+91-8792136657*
*+91-7483122727*
*https://www.facebook.com/profile.php?id=10655377926 *

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] immediate Need of C# Developer in Ft. Lauderdale, FL

2011-05-23 Thread sohail panzer
Dear Professional,
Hope you are doing well.
I am a technical recruiter with Panzer Solutions LLC Software Implementing
and IT consulting company located in CT. Please go through the Job
Description and send me your updated resume with contact information.

*Please reply at soh...@panzersolutions.com
*
Title  :C# Developer
Location   :Ft. Lauderdale, FL
Duration  :6+ months contract
Rate  :$33 hr on C2C or 1099


*Must-haves *
Minimum 4+ years of directly related work experience.
Strong knowledge of powershell scripting
Programming knowledge of C# and .NET (ASP.NET  preferred).
Experience with debugging tools (WinDbg, CDB) to determine faulting module
Understands application use cases, understands the requirements and helps
drive major changes, if necessary through the appropriate channels.

*Plusses *
Knowledge of Perforce and build systems

*Responsibilities*
This position is on the build team but is a developer role. It will be 85%
development using C# and powershell. They will be developing tools to
improve build process.
Design, develop and implement automated tools for improving and automating
build processes.
Responsible for designing and developing automated tools to improve and
automate build process.
Follows standards of test automation development by having code reviews with
lead and developers.
Ensures all automated tools developed are properly integrated with existing
build systems like Vulcun and argon.
*C# developer that understands testing!




Thank you,

Sohail Khan | Technical Recruiter
Panzer Solutions LLc
45 Stuart Ave, K
Norwalk, CT 06850 USA
Voice: 203-813-2052
soh...@panzersolutions.com
URL: www.panzersolutions.com

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Find closest point

2011-05-23 Thread Don
If I have a big database of points on the surface of the earth, each
one represented as a latitude and longitude, provide an efficient
algorithm to find the point closest to a requested location. Be sure
to consider angle wrap.

Don

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Spoj Problem Help

2011-05-23 Thread ankit sambyal
we can use the following formula to calculate the nth fibonacci no. in O(log
n) time : fib(n)=round((pow(phi,n))/sqrt(5) + 1/2)  where phi=(1+sqrt(5))/2;

And by taking care of the special cases and by using the fact that  the problem
is just to find the (N+3)th fibonacci number for given N, we can proceed





On Mon, May 23, 2011 at 8:17 AM, Aakash Johari wrote:

> @akshata, sravanreddy: yes, for more info regarding matrix expo. you can go
> through http://zobayer.blogspot.com/2010/11/matrix-exponentiation.html
>
>
> On Mon, May 23, 2011 at 7:28 AM, Akshata Sharma  > wrote:
>
>> @sravanreddy001
>> by matrix exponential method, we can calculate the nth fibonacci number in
>> logarithmic time.
>>
>>
>> On Mon, May 23, 2011 at 7:39 PM, anshu mishra 
>> wrote:
>>
>>> @sravanreddy001
>>> suppose u have to calulate A^n u can calculate in O(d^3*log(n));
>>> d is dimesion of matrixl
>>> while (n)
>>> {
>>> if (n&1) mul(ans, A, d);
>>> mul(A, A, d);
>>> n >>=1;
>>> }
>>>
>>>
>>> --
>>> Anshuman Mishra
>>> IIIT Allahabad
>>> -
>>>
>>> anshumishra6...@gmail.com
>>> rit2007...@iiita.ac.in
>>>
>>>  --
>>> 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 group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  --
>> 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 group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> -Aakash Johari
> (IIIT Allahabad)
>
>
>
>
>
>  --
> 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 group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] ATG Developer -- Vernon Hills, IL -- 12 Months contract

2011-05-23 Thread sohail panzer
Hello,
Hope you are doing well.
I am a technical recruiter with Panzer Solutions LLC Software Implementing
and IT consulting company located in CT. Please go through the Job
Description and send me your updated resume with contact information.

*Please reply at soh...@panzersolutions.com
*
Title  :   ATG Developer
Location   :   Vernon Hills, IL
Duration  :   12 Months contract


MUST HAVES:
Expert level ATG development experience (5-7 years)
Specific experience developing ATG version 9.1
Familiarity and experience with Java based programming
Exceptional communication skills
Interpersonal communication is extremely important as they will be working
closely in teams and collaborating with other development groups

** For the Lead Developer role add experience leading ATG development
projects & enhancements

Responsibilities
This organizations client in Vernon Hills just launched their new ecommerce
website 30 days ago.  They have a series of projects lined up that tie
together a set of large enhancements. This is not just implementation work,
but extension and integration into their applications.  The rest of the
client’s applications are .NET based, but the ATG commerce suite is Java.
No .NET experience is necessary.



Thank you,

Sohail Khan | Technical Recruiter
Panzer Solutions LLc
45 Stuart Ave, K
Norwalk, CT 06850 USA
Voice: 203-813-2052
soh...@panzersolutions.com
URL: www.panzersolutions.com

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Spoj Problem Help

2011-05-23 Thread Dave
@Akshata: Actually, you only need to find the n+3rd Fibonacci number,
modulus 17. This saves you from having to deal with big
integers. Something like this should do for the calculation, assuming
that long long int is 64 bits:

long long int n;
int a = 1, b = 2, c;
for(i = 0; i < n, i++)
{
c = a+b % 17;
a = b;
b = c
}
// c is the result

Dave



On May 23, 12:36 am, Akshata Sharma  wrote:
> It appers that the problem is just to find the (N+3)th fibonacci number for
> given N. Since N is very large, how to find nth fibonaci number for such a
> large n??
>
>
>
> On Mon, May 23, 2011 at 7:51 AM, tec  wrote:
> > Try thinking backwards.
> > (0,1),(1,2),(2,3),(3,5),(5,8),(8,13),...
>
> > 2011/5/22 shady :
> > > Hey,
> > > Can anyone tell how to solve this problem in Spoj ? I went through
> > > some material but there all they were discussing was on complexity and
> > > not on actual number of iterations.
> > >http://www.spoj.pl/problems/MAIN74/
>
> > > Thanks.
>
> > > --
> > > 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 group at
> >http://groups.google.com/group/algogeeks?hl=en.
>
> > --
> > __
>
> > --
> > 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 group at
> >http://groups.google.com/group/algogeeks?hl=en.- Hide quoted text -
>
> - Show quoted text -

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Spoj Problem Help

2011-05-23 Thread Dave
Replying to my own posting! Even better, since it replaces the
relatively slow modulus operation with a comparison and subtraction:

long long int n;
int a = 1, b = 2, c;
for(i = 0; i < n, i++)
{
c = a + b;
a = b;
b = c < 17 ? c : c - 17;
}
// b is the result

Dave


On May 23, 7:30 pm, Dave  wrote:
> @Akshata: Actually, you only need to find the n+3rd Fibonacci number,
> modulus 17. This saves you from having to deal with big
> integers. Something like this should do for the calculation, assuming
> that long long int is 64 bits:
>
> long long int n;
> int a = 1, b = 2, c;
> for(i = 0; i < n, i++)
> {
>     c = a+b % 17;
>     a = b;
>     b = c}
>
> // c is the result
>
> Dave
>
> On May 23, 12:36 am, Akshata Sharma  wrote:
>
>
>
> > It appers that the problem is just to find the (N+3)th fibonacci number for
> > given N. Since N is very large, how to find nth fibonaci number for such a
> > large n??
>
> > On Mon, May 23, 2011 at 7:51 AM, tec  wrote:
> > > Try thinking backwards.
> > > (0,1),(1,2),(2,3),(3,5),(5,8),(8,13),...
>
> > > 2011/5/22 shady :
> > > > Hey,
> > > > Can anyone tell how to solve this problem in Spoj ? I went through
> > > > some material but there all they were discussing was on complexity and
> > > > not on actual number of iterations.
> > > >http://www.spoj.pl/problems/MAIN74/
>
> > > > Thanks.
>
> > > > --
> > > > 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 group at
> > >http://groups.google.com/group/algogeeks?hl=en.
>
> > > --
> > > __
>
> > > --
> > > 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 group at
> > >http://groups.google.com/group/algogeeks?hl=en.-Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Spoj Problem Help

2011-05-23 Thread Balaji S
@Dave: nice idea.. ll this give AC ?

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Another SPOJ Problem -SIGSEGV -- Need Help

2011-05-23 Thread saurabh singh
See if you want to learn how to compile a c code without main(),then this
can be done by chosing different entry points like _start or _asm and then
compiling it as gcc -O3 -nostartfiles ..
But since in spoj you cant alter the way gcc compiles(I am not sure i assume
we cant do that),you have to think some alternate way.I have given you
hints.You have to use c as a window for the assembly code.DO some research
it will be fun...I dont think you will like it if i give you the solution
right away.And yes asm is not a different language,its just that the c code
is an abstraction to that asm codes.All codes eventualy are converted in asm
instruction codes.And with regard to this problem they both merge
PS:Please excuse i am bad at explainig things.

On Mon, May 23, 2011 at 11:42 PM, Dumanshu  wrote:

> I want to discuss the solution in C language. I want to test my file
> using gcc compiler. For C the best solution is 5 chars. Any ideas
> about that??
>
> On May 23, 7:23 pm, saurabh singh  wrote:
> > Using the asm construct of c..
> > Though i did this problem in native asm and my solution is 3 char
> ;)...
> > The point is you  have to know if not proficient with NASM(Net Assembler
> > used by SPOJ)...
> > If you need the solution mail me.
> >
> > --
> > Saurabh Singh
> > B.Tech (Computer Science)
> > 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 algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
Saurabh Singh
B.Tech (Computer Science)
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 algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Spoj Problem Help

2011-05-23 Thread ankit sambyal
@Balaji : By using Dave's algo it gives TLE and it should be ...try taking n
as large as 10^18.  How did u reduce the no. of iterations in this case
??



On Mon, May 23, 2011 at 9:07 PM, Balaji S  wrote:

> @Dave: nice idea.. ll this give AC ?
>
> --
> 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 group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] how to convert a floating point number into binary representation.

2011-05-23 Thread saurabh agrawal


-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks]

2011-05-23 Thread immanuel kingston
#define MAX_BITS_FOR_INT=32;

int getIthBit(int n, int i) {
 return (n & 1<> i;
}
bool isPalindrome(int num) {
int i=0;
int j= MAX_BITS_FOR_INT - 1;
while (i < j) {
  int ithbit = getIthBit(num, i);
  int jthbit = getIthBit(num, j);
  if ( ithbit ^ jthbit) return false;
  i++;j--;
}
return true;
}

Thanks,
Immanuel

On Tue, May 24, 2011 at 12:42 AM, Piyush Sinha wrote:

> Constraint is no extra space and the complexity should be as efficient
> as possible.
>
> On 5/24/11, Piyush Sinha  wrote:
> > Find whether the binary representation of a number is palindrome or
> > not. The input begins with integer N.
> > --
> > *Piyush Sinha*
> > *IIIT, Allahabad*
> > *+91-8792136657*
> > *+91-7483122727*
> > *https://www.facebook.com/profile.php?id=10655377926 *
> >
> > --
> > 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 group at
> > http://groups.google.com/group/algogeeks?hl=en.
> >
> >
>
>
> --
> *Piyush Sinha*
> *IIIT, Allahabad*
> *+91-8792136657*
> *+91-7483122727*
> *https://www.facebook.com/profile.php?id=10655377926 *
>
> --
> 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 group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] how to convert a floating point number into binary representation.

2011-05-23 Thread Naveen Kumar
http://kipirvine.com/asm/workbook/floating_tut.htm


On Tue, May 24, 2011 at 12:09 PM, saurabh agrawal wrote:

>
>  --
> 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 group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Cheers
Naveen Kumar

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Spoj Problem Help

2011-05-23 Thread sravanreddy001
@Dave,Balaji,Samby.. Without the matrix exponentiation, the time is not 
possible, and without using the intermediate modulo operater as suggested by 
Dave, the value cannot be accommodated, as the 300th fibinocci number alone 
comes to
--> 3224462942044552973989346190996720939096499764990979600
So, a mix of both are needed.. I'll try to look into this.
 
any alternate solution you can think of?

-- 
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 group at 
http://groups.google.com/group/algogeeks?hl=en.