[algogeeks] Re: Run for a google years

2011-05-10 Thread Dave
@Aamir: First, regarding overflow, 1000 = -128. Thus, the cycle is 0, 1, 2, ..., 127, -128, -127, ..., -1, and back to 0. Second, regarding your assertion that you only need a single character instead of an array of them: Based on the above sequence, every time a[0] cycles back to 0, p is set

Re: [algogeeks] Re: GOOGLE INTERVIEW QUESTION

2011-05-10 Thread Anders Ma
take “aabab” for example, the result is "aba, b,a"; however, the right result is "aa,bab" On Wed, May 11, 2011 at 10:57 AM, shubham wrote: > check this one out: > > #include > #include > #include > #include > using namespace std; > int check_palin(string str,int *start) > { >    int pos=-1,ret,s

[algogeeks] Re: GOOGLE INTERVIEW QUESTION

2011-05-10 Thread shubham
check this one out: #include #include #include #include using namespace std; int check_palin(string str,int *start) { int pos=-1,ret,size=str.size()-1; char last_char=str[size]; while(pos palin,str; cin>>arr;str.push_back(arr); while(arr!="") { int s=0,e=0,max=0,sta

Re: [algogeeks] Fwd: Problems

2011-05-10 Thread pacific :-)
> > For the question 4 , >>> >> Choose a nut , try all bolts and then remove the one that fits.Now choose another nut and try with the rest of the bolts. Is this the best possible method ? complexity : best case 0( n ) worst case 0( n ^ 2) average case 0 ( n

Re: [algogeeks] Re: Extract Top K elements from a List of N elements based on frequency

2011-05-10 Thread Aamir Khan
On Mon, May 9, 2011 at 11:44 AM, Ashish Goel wrote: > Dave, > w.r.t statement, After all integers are processed, compress out the unused > hash table > entries and find the Kth largest element, > > > I could not understand the compress concept...are you saying something on > counting sort philoso

Re: [algogeeks] Re: Run for a google years

2011-05-10 Thread Aamir Khan
On Mon, May 9, 2011 at 8:31 PM, Don wrote: > That would do it if you have a 64-bit type, which most implementations > have, but the standard does not require. > I think that I can make it shorter and cleaner. > > int main(int argc, char* argv[]) > { >const int n=49; >char a[n]={0}; > I t

[algogeeks] Re: MATHS TRICK TEASER 9 may

2011-05-10 Thread Dave
19 = XIX in Roman Numerals. Take 1 = I away and you have XX = 20. Dave On May 10, 2:09 am, Lavesh Rawat wrote: > *MATHS TRICK TEASER >  * > * > * > ** > *Prove that taking away 1 from 19 makes 20. > * > > *Update Your Answers at* : Click > Here

Re: [algogeeks] Need the algorithm or idea

2011-05-10 Thread pacific :-)
You may have to use a trie and also the edit distance for this problem. Firstly , walk down the trie as you can keep matching the alphabets. When you encounter a first mismatch , findout the edit distance for the rest of the substring of the input with all of the strings possible from that node do

Re: [algogeeks] Re: Amazon Interview Question

2011-05-10 Thread pacific :-)
My approach : Have a pointer to the start (smallest of the array) of each of the N arrays. Until all pointers reach end of respective arrays : take the smallest value from all of the pointers and compute the difference between the smallest and the current pointers of each of the arrays

Re: [algogeeks] GOOGLE INTERVIEW QUESTION

2011-05-10 Thread Senthil S
Hello Anders Ma .. for inputs like "iiestseig" (just a random string) your code will not produce the correct output .. cos the best possible way to split these strings is {"i","iestsei","g"} .. But your code will produce {"ii","este","i","g"} as output .. so when there are overlapping palindromes y

[algogeeks] Re: Test Cases

2011-05-10 Thread Don
I would add that you should test all combinations of positive and negative operands. You are not clear about the type being divided. If it is a floating point type, you can verify that (a*b) / b = a to an acceptable tolerance for a wide variety of values of a and b. If you are working with integers

[algogeeks] Urgent need a Sr. ABAP Developer//Fremont, CA//4 Months Contract

2011-05-10 Thread peter req
*Urgent need a Sr. ABAP Developer* *Please send updated Resume at **peter@gmail.com * *Start date: 05/23/2011* *Duration: 4 Months Contract* *Location: Fremont, CA* *Rate: Open* *Job Role & Skill set:* Application Developer - SAP.ABAP *Service: SAP* *Requested service/service area: SAP

Re: [algogeeks] Test Cases

2011-05-10 Thread Praveen Kumar
cases would be: 1. division by 0 raises an appropriate Exception 2. dividing 0 by any number should result in 0 3. dividing any number by 1 should give the same number 4. a = b*q + r i.e a/b should give q On Tue, May 10, 2011 at 7:52 PM, Carl Barton wrote: > Don't really get the question > > > On

Re: [algogeeks] Test Cases

2011-05-10 Thread Carl Barton
Don't really get the question On 10 May 2011 09:08, Akshata Sharma wrote: > write test cases for the division '/' operator.. > > -- > 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

Re: [algogeeks] [brain teaser] MATHS TRICK TEASER 9 may

2011-05-10 Thread saurabh singh
superlyk utkarsh solution.. On Tue, May 10, 2011 at 7:15 PM, UTKARSH SRIVASTAV wrote: > 19=10011 > 20=10100 > therefore take leftmost one from 19 and shift second one left and > make it 10100=20 > > > On Tue, May 10, 2011 at 12:15 AM, Vandana Bachani > wrote: > >> 1 from 19 makes 20

Re: [algogeeks] [brain teaser] MATHS TRICK TEASER 9 may

2011-05-10 Thread UTKARSH SRIVASTAV
19=10011 20=10100 therefore take leftmost one from 19 and shift second one left and make it 10100=20 On Tue, May 10, 2011 at 12:15 AM, Vandana Bachani wrote: > 1 from 19 makes 20 > 11 + 9 = 20 (take the one away from 19 and attach it to the other one and > put a + between the 2) > > -Vand

[algogeeks] Test Cases

2011-05-10 Thread Akshata Sharma
write test cases for the division '/' operator.. -- 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...@googlegroup

Re: [algogeeks] [brain teaser] MATHS TRICK TEASER 9 may

2011-05-10 Thread Vandana Bachani
1 from 19 makes 20 11 + 9 = 20 (take the one away from 19 and attach it to the other one and put a + between the 2) -Vandana On Tue, May 10, 2011 at 12:39 PM, Lavesh Rawat wrote: > *MATHS TRICK TEASER > * > * > * > ** > *Prove that taking away 1 from 19 makes 20. > * > > *Update Your Answers at

[algogeeks] Regarding the Master's project

2011-05-10 Thread Sweety
Hi All, I am student at CSUS. I am looking some topics on database or cloud computing for my Master's project. It would be helpful, if anyone provides me an good idea on it. Thanks, Sweety -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To

[algogeeks] [brain teaser] MATHS TRICK TEASER 9 may

2011-05-10 Thread Lavesh Rawat
*MATHS TRICK TEASER * * * ** *Prove that taking away 1 from 19 makes 20. * *Update Your Answers at* : Click Here Solution: Will be updated after 1 day -- "Never explain yourself.