Re: [algogeeks] Re: char *arr and char arr[]

2011-06-27 Thread sagar pareek
@oppilas char *ptr=hello in this case the string becomes constant but not the ptr, you can do this. char *ptr=hello; char arr[]=hi; ptr[0]=B; //not work ptr=arr; //work arr[0]=H; //work ptr[0]=N; //work Only string Hello becomes constant, it cant be changed. Read - const char *ptr , char const

[algogeeks] Re: OS

2011-06-27 Thread Mihir
@Sanket: You are wrong. Check the loops again! -- 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/-/ifxkh_x5o0EJ. To post to this group, send email to

Re: [algogeeks] image processing

2011-06-27 Thread Arun Vishwanathan
yes it is matching points between 2 different pictures of the same object taken in different environments..not different views of the same object On Sun, Jun 26, 2011 at 5:57 PM, sukhmeet singh sukhmeet2...@gmail.comwrote: YES.. we need to have 2 shots.. !! u said u had some matching points

[algogeeks] OS

2011-06-27 Thread Nishant Mittal
plz recommend me some good sites for OS interview questions... Thanx in advance -- 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

Re: [algogeeks] given a bst and a value x.find pair of nodes in the tree that sum upto x

2011-06-27 Thread Bharath Soma
HI Do an inorder traversal on that bst n form a sorted array...then u can search for that 2 elements in O(n) On Mon, Jun 27, 2011 at 2:01 PM, manish kapur manishkapur.n...@gmail.comwrote: -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group.

Re: [algogeeks] given a bst and a value x.find pair of nodes in the tree that sum upto x

2011-06-27 Thread Nishant Mittal
do inorder traversal of tree and store values in an array. Now find pairs by applying binary search on array.. On 6/27/11, manish kapur manishkapur.n...@gmail.com wrote: -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this

[algogeeks] MS question

2011-06-27 Thread Nishant Mittal
WAP to sort an array of character strings on the basis of last character of each string eg:- {xxxc , yyya, zzzb} = {yyya , zzzb, xxxc} -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] OS

2011-06-27 Thread Navneet Gupta
One such resource http://placementsindia.blogspot.com/search/label/Operating%20Systems On Mon, Jun 27, 2011 at 2:01 PM, Nishant Mittal mittal.nishan...@gmail.com wrote: plz recommend me some good sites for OS interview questions... Thanx in advance -- You received this message because

Re: [algogeeks] given a bst and a value x.find pair of nodes in the tree that sum upto x

2011-06-27 Thread ankit sambyal
@Bharath : Cud u plz explain how r u searching the elements in O(n) time? Because if we use binary search, it will have O(n*log n ) worst case time complexity. One way in which I think it cud be made O(n) is that we can use a hash table, with a good hash function apart frm the array. And then for

Re: [algogeeks] MS question

2011-06-27 Thread varun pahwa
reverse all strings and then sort. On Mon, Jun 27, 2011 at 2:28 PM, Nishant Mittal mittal.nishan...@gmail.comwrote: WAP to sort an array of character strings on the basis of last character of each string eg:- {xxxc , yyya, zzzb} = {yyya , zzzb, xxxc} -- You received this message because

Re: [algogeeks] given a bst and a value x.find pair of nodes in the tree that sum upto x

2011-06-27 Thread Nishant Mittal
(for array sorted in ascending order) take 2 indexes i and j pointing to 1st and last element of the array respectively... now if(arr[i]+arr[j] == x) print(arr[i]); print(arr[j]; else if(arr[i]+arr[j]x) j--; else i++; I think this should work...(i've not checked) correct me if i m wrong On

Re: [algogeeks] given a bst and a value x.find pair of nodes in the tree that sum upto x

2011-06-27 Thread varun pahwa
@ankit: no need to use hash table for that. simply run two pointers one from 0 and second from n - 1. On Mon, Jun 27, 2011 at 2:51 PM, ankit sambyal ankitsamb...@gmail.comwrote: @Bharath : Cud u plz explain how r u searching the elements in O(n) time? Because if we use binary search, it will

Re: [algogeeks] given a bst and a value x.find pair of nodes in the tree that sum upto x

2011-06-27 Thread Piyush Sinha
Instead of using an array...we can do this by converting the BST into a doubly linked list...but this will definitely modify the BST.. On Mon, Jun 27, 2011 at 3:01 PM, varun pahwa varunpahwa2...@gmail.comwrote: @ankit: no need to use hash table for that. simply run two pointers one from 0 and

[algogeeks] [brain teaser ] Statement Riddle

2011-06-27 Thread Lavesh Rawat
*Statement Riddle - 27 june * * * ** *'Ferari driver' easily beats the 'force indain driver' in a two care race.How did Indian newspapers * *truthfully report so to look as 'force indain drive' had outdone the 'ferari driver' Think ?? * *Update Your Answers at* : Click

Re: [algogeeks] [brain teaser ] Statement Riddle

2011-06-27 Thread shady
if moderators are alive, can they ban him ? On Mon, Jun 27, 2011 at 12:48 PM, Lavesh Rawat lavesh.ra...@gmail.comwrote: *Statement Riddle - 27 june * * * ** *'Ferari driver' easily beats the 'force indain driver' in a two care race.How did Indian newspapers * *truthfully report so to

Re: [algogeeks] [brain teaser ] Statement Riddle

2011-06-27 Thread Shachindra A C
+1 to shady's post. Please ban him. On Mon, Jun 27, 2011 at 5:32 PM, shady sinv...@gmail.com wrote: if moderators are alive, can they ban him ? On Mon, Jun 27, 2011 at 12:48 PM, Lavesh Rawat lavesh.ra...@gmail.comwrote: *Statement Riddle - 27 june * * * ** *'Ferari driver' easily

Re: [algogeeks] [brain teaser ] Statement Riddle

2011-06-27 Thread sharad kumar
i have added anton nomiste as the new moderator... On Mon, Jun 27, 2011 at 5:36 PM, sharad kumar aryansmit3...@gmail.comwrote: banned!!! On Mon, Jun 27, 2011 at 5:32 PM, shady sinv...@gmail.com wrote: if moderators are alive, can they ban him ? On Mon, Jun 27, 2011 at 12:48 PM, Lavesh

[algogeeks] Cisco Question

2011-06-27 Thread rShetty
Given a byte, write a code to swap every two bits. [Using bit operators] Eg: Input: 10 01 11 01 Output: 01 10 11 10 -- 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

Re: [algogeeks] Re: O(n) Time is the problem. ..

2011-06-27 Thread Bhavesh agrawal
can anyone plz post the code for this problem -- 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] Re: given a bst and a value x.find pair of nodes in the tree that sum upto x

2011-06-27 Thread Dave
@Nishant: No need to store the data in an array. Do two inorder traversals simultaneously. Let u and v be the current nodes of the two traversals, respectively. If u + v x, then advance the v traversal. If u + v x, advance the u traversal. Dave On Jun 27, 3:40 am, Nishant Mittal

[algogeeks] Re: Cisco Question

2011-06-27 Thread Dave
y = ((x 0x55) 1) | ((x 1) 0x55). Note, 0x55 = 01010101 in binary. Dave On Jun 27, 7:18 am, rShetty rajeevr...@gmail.com wrote: Given a byte, write a code to swap every two bits. [Using bit operators]  Eg: Input: 10 01 11 01 Output: 01 10 11 10 -- You received this message because you

[algogeeks] Re: Statement Riddle

2011-06-27 Thread Dave
Force indain driver finishes second in race. Ferari was next to last. Dave On Jun 27, 2:18 am, Lavesh Rawat lavesh.ra...@gmail.com wrote: *Statement Riddle  - 27 june  * * * ** *'Ferari driver' easily beats the 'force indain driver' in a two care race.How did Indian newspapers *

Re: [algogeeks] Re: given a bst and a value x.find pair of nodes in the tree that sum upto x

2011-06-27 Thread sunny agrawal
@Dave i think your solution won't work consider inorder traversal of a BST is 1 6 7 8 15 and x = 14 initially both u,v (1,1) according to u your algorithm will proceed like (1,1) - (1,6) - (1,7) - (1,8) - (1,15) - (6,15) - (15,15) and clearly in second step of your solution if (u+v)

Re: [algogeeks] Re: Cisco Question

2011-06-27 Thread rajeev bharshetty
@ Dave How to think about the answer to the above question . I mean How do I tackle such problems ? On Mon, Jun 27, 2011 at 6:17 PM, Dave dave_and_da...@juno.com wrote: y = ((x 0x55) 1) | ((x 1) 0x55). Note, 0x55 = 01010101 in binary. Dave On Jun 27, 7:18 am, rShetty

Re: [algogeeks] Re: Cisco Question

2011-06-27 Thread piyush kapoor
Yep,I also want to know the same.. On Mon, Jun 27, 2011 at 6:23 PM, rajeev bharshetty rajeevr...@gmail.comwrote: @ Dave How to think about the answer to the above question . I mean How do I tackle such problems ? On Mon, Jun 27, 2011 at 6:17 PM, Dave dave_and_da...@juno.com wrote: y = ((x

Re: [algogeeks] given a bst and a value x.find pair of nodes in the tree that sum upto x

2011-06-27 Thread vaibhav agarwal
@varun: where does the algo stops? when the two pointer crosses over or both of them reaches other opposite end. On Mon, Jun 27, 2011 at 3:04 PM, Piyush Sinha ecstasy.piy...@gmail.comwrote: Instead of using an array...we can do this by converting the BST into a doubly linked

Re: [algogeeks] Anyone have The google resume book

2011-06-27 Thread Vivek Srivastava
Hi swathi, What do you mean exactly by the google resume book? On Sun, Jun 26, 2011 at 10:50 PM, Swathi chukka.swa...@gmail.com 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] Re: Nagarro Question

2011-06-27 Thread juver++
Here it is: http://arxiv.org/PS_cache/arxiv/pdf/0805/0805.1598v1.pdf On Jun 27, 5:02 am, Ankit Sablok ankitsablok19091...@gmail.com wrote: Need a Better Algorithm here is a trivial question we are given an array of 2n elements in the form {a1,a2,a3,..,an,b1,b2,b3b...bn} we need to

[algogeeks] Re: given a bst and a value x.find pair of nodes in the tree that sum upto x

2011-06-27 Thread juver++
It doesn't work. In your idea values of nodes represented by u and v always increased, cause you are doing inorder traversal. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit

[algogeeks] Re: given a bst and a value x.find pair of nodes in the tree that sum upto x

2011-06-27 Thread Dave
@Sunny. Mea culpa. You are correct. Revised (and correct) algorithm. Do two inorder traversals, one in the usual (descend to the left before descendung to the right) direction and the other in the reversed(descend to the right before descending to the left) direction. Let u and r be the current

[algogeeks] Re: given a bst and a value x.find pair of nodes in the tree that sum upto x

2011-06-27 Thread juver++
Yes, now it is fine enough :) -- 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/-/8z1hcl2hQskJ. To post to this group, send email to algogeeks@googlegroups.com.

Re: [algogeeks] Anyone have The google resume book

2011-06-27 Thread Swathi
This book http://www.amazon.com/gp/product/0470927623/ref=as_li_ss_tl?ie=UTF8tag=care01-20linkCode=as2camp=1789creative=390957creativeASIN=0470927623 Thanks, swathi On Mon, Jun 27, 2011 at 6:50 PM, Vivek Srivastava srivastava.vivek1...@gmail.com wrote: Hi swathi, What do you mean exactly

Re: [algogeeks] Re: given a bst and a value x.find pair of nodes in the tree that sum upto x

2011-06-27 Thread Swathi
Dave, Can you provide the psuedo code for this.. Thanks, Swathi On Mon, Jun 27, 2011 at 7:30 PM, Dave dave_and_da...@juno.com wrote: @Sunny. Mea culpa. You are correct. Revised (and correct) algorithm. Do two inorder traversals, one in the usual (descend to the left before descendung to the

[algogeeks] URGENT Requirerment for C#.NET Developer in Columbus, OH 6+ Months

2011-06-27 Thread Aakif - Gain America, Inc.
Hello, We have a hot opening for... Job Title: C#.NET Developer Location: Columbus, OH Duration: 6+ Months Must be onsite interview. Job Profile: These resources will be developing multiple applications. Experience with C#, .NET, Agile, TFS and Java Scripts is a must.

[algogeeks] Reverse

2011-06-27 Thread rShetty
Reversing a String without using a temporary variable ? Rajeev N B -- 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

Re: [algogeeks] Re: given a bst and a value x.find pair of nodes in the tree that sum upto x

2011-06-27 Thread Bharath Soma
@ankit, sorry i was mistaken its O(nlogn) for searching the two elements... On Mon, Jun 27, 2011 at 8:04 PM, Swathi chukka.swa...@gmail.com wrote: Dave, Can you provide the psuedo code for this.. Thanks, Swathi On Mon, Jun 27, 2011 at 7:30 PM, Dave dave_and_da...@juno.com wrote:

Re: [algogeeks] Re: given a bst and a value x.find pair of nodes in the tree that sum upto x

2011-06-27 Thread varun pahwa
suppose k is the sum to be found. @vaibhav: yes it will stop when crossing is there means (j must be greater than i).initially sum = a[i] + a[j] (where i = 0 n j = n- 1) n we will increase i when sum is less than k and decrease j when sum k.stop if sum == k. and if no i , j found till j i. then

Re: [algogeeks] Re: Cisco Question

2011-06-27 Thread piyush kapoor
thanks a lot for the wonderful explanation :-) On Mon, Jun 27, 2011 at 7:17 PM, Dave dave_and_da...@juno.com wrote: @Rajeev and Piyush: Numbering the bits from the right starting with 0 as usual, you see that you need to move the even-numbered bits one bit to the left and the odd-numbered

[algogeeks] Re: MS question

2011-06-27 Thread Sanket
Do we really need to reverse? Can't we apply any normal sorting algo like merge sort or quick sort and for the comparison part of it, use the last characters of each string only? On Jun 27, 4:21 am, varun pahwa varunpahwa2...@gmail.com wrote: reverse all strings and then sort. On Mon, Jun 27,

[algogeeks] Re: O(n) Time is the problem. ..

2011-06-27 Thread Sanket
@Dave - Wouldn't your solution also become O(kn) where k = number of bits in the number? In this summation - O(n) + O(n/2) + O(n/4) + ...= O(n) - you would have O(n) appearing 'k' times. Each entry is O(n/ 2^i) where 'i' is the bit position from right to left, starting at 0. The range of 'i' is

Re: [algogeeks] Re: spoj shlights

2011-06-27 Thread pacific :-)
Can one of you provide some hints in solving this problem ? On Sat, Jun 25, 2011 at 3:34 PM, kartik sachan kartik.sac...@gmail.comwrote: @jitendra that's what i am asking forwhat algo i should implement to get process in 1 sec? -- You received this message because you are

Re: [algogeeks] Re: given a bst and a value x.find pair of nodes in the tree that sum upto x

2011-06-27 Thread vaibhav agarwal
@varun: Thanks... On Mon, Jun 27, 2011 at 9:18 PM, varun pahwa varunpahwa2...@gmail.comwrote: suppose k is the sum to be found. @vaibhav: yes it will stop when crossing is there means (j must be greater than i).initially sum = a[i] + a[j] (where i = 0 n j = n- 1) n we will increase i when

Re: [algogeeks] Re: spoj shlights

2011-06-27 Thread harshit pahuja
hint is : go for counting ,not for shifting o(n). :P On Mon, Jun 27, 2011 at 9:29 PM, pacific :-) pacific4...@gmail.com wrote: Can one of you provide some hints in solving this problem ? On Sat, Jun 25, 2011 at 3:34 PM, kartik sachan kartik.sac...@gmail.comwrote: @jitendra that's what

[algogeeks] Re: Finding a number from 300million list with constraint on memory.

2011-06-27 Thread Sanket
That is true Dave. Since the numbers are random, we could very well have that scenario. To reduce this possibility, we can reverse the allocation - 1.5MB for the array and 500KB for the input. Since the input is going to be read sequentially, we would need to swap only after exhausting all the

Re: [algogeeks] Re: Statement Riddle

2011-06-27 Thread Vishal Thanki
this may be a reverse race, who comes last will win.. On Mon, Jun 27, 2011 at 6:22 PM, Dave dave_and_da...@juno.com wrote: Force indain driver finishes second in race. Ferari was next to last. Dave On Jun 27, 2:18 am, Lavesh Rawat lavesh.ra...@gmail.com wrote: *Statement Riddle  - 27

[algogeeks] Re: OS

2011-06-27 Thread Sanket
@Mihir - Yea, I missed the semi-colon, got it now :-) On Jun 27, 2:00 am, Mihir mihirmpa...@gmail.com wrote: @Sanket: You are wrong. Check the loops 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] Re: Nagarro Question

2011-06-27 Thread Sanket
@Juver - I am getting Access denied for the pdf link you sent :( On Jun 27, 8:48 am, juver++ avpostni...@gmail.com wrote: Here it is:http://arxiv.org/PS_cache/arxiv/pdf/0805/0805.1598v1.pdf On Jun 27, 5:02 am, Ankit Sablok ankitsablok19091...@gmail.com wrote: Need a Better Algorithm

Re: [algogeeks] Reverse

2011-06-27 Thread Kamakshii Aggarwal
#include stdio.h #include stdlib.h void revers(char *s) { if(*s) { revers(++s); s--; printf(%c ,*s); } } int main(int argc, char *argv[]) { char arr[]=string; revers(arr); system(PAUSE); return 0; } will s

Re: [algogeeks] Reverse

2011-06-27 Thread Vishal Thanki
this code will only print, it will not store the reverse string. On Mon, Jun 27, 2011 at 9:53 PM, Kamakshii Aggarwal kamakshi...@gmail.com wrote: #include stdio.h #include stdlib.h void revers(char *s) {      if(*s)      {                     revers(++s);                     s--;        

Re: [algogeeks] Reverse

2011-06-27 Thread Vishal Thanki
and yes, s will be stored in stack everytime you call the function, so its a temp variable.. string reverse is a simple logic, just iterate i through 1 to n/2 and swap the i to n-i On Mon, Jun 27, 2011 at 10:06 PM, Vishal Thanki vishaltha...@gmail.com wrote: this code will only print, it will

Re: [algogeeks] Re: spoj shlights

2011-06-27 Thread vaibhav agarwal
consider G as 1, B as 0 so actually its series of 1 and 0's now consider any sequence GBGBBGGGBG will be represented as 1010011101 objective is to push all 1's at the right end. all '10' pairs need to be swapped at the same time. considering this take for ex 101 the number of swaps is equal to

Re: [algogeeks] Reverse

2011-06-27 Thread vaibhav shukla
and how will swap without using temp variable ? On Mon, Jun 27, 2011 at 10:07 PM, Vishal Thanki vishaltha...@gmail.comwrote: and yes, s will be stored in stack everytime you call the function, so its a temp variable.. string reverse is a simple logic, just iterate i through 1 to n/2 and

Re: [algogeeks] Reverse

2011-06-27 Thread vaibhav agarwal
@vaibhav just like u swap two int variable without using 3rd On Mon, Jun 27, 2011 at 10:17 PM, vaibhav shukla vaibhav200...@gmail.comwrote: and how will swap without using temp variable ? On Mon, Jun 27, 2011 at 10:07 PM, Vishal Thanki vishaltha...@gmail.comwrote: and yes, s will be stored

Re: [algogeeks] Reverse

2011-06-27 Thread vaibhav shukla
h.yup On Mon, Jun 27, 2011 at 10:18 PM, vaibhav agarwal vibhu.bitspil...@gmail.com wrote: @vaibhav just like u swap two int variable without using 3rd On Mon, Jun 27, 2011 at 10:17 PM, vaibhav shukla vaibhav200...@gmail.comwrote: and how will swap without using temp variable ?

[algogeeks] Re: Cisco Question

2011-06-27 Thread rShetty
@Dave Thank You very much :) On Jun 27, 8:48 pm, piyush kapoor pkjee2...@gmail.com wrote: thanks a lot for the wonderful explanation :-) On Mon, Jun 27, 2011 at 7:17 PM, Dave dave_and_da...@juno.com wrote: @Rajeev and Piyush: Numbering the bits from the right starting with 0 as

Re: [algogeeks] Office Suite

2011-06-27 Thread vaibhav agarwal
@radha: hw abt using a fixed size circular list? On Sat, Jun 25, 2011 at 8:25 PM, radha krishnan radhakrishnance...@gmail.com wrote: simple!! Stack:P On Sat, Jun 25, 2011 at 8:11 PM, rShetty rajeevr...@gmail.com wrote: Suggest the most efficient Data Structures and algorithms to

Re: [algogeeks] Office Suite

2011-06-27 Thread radha krishnan
You asked the Most Efficient dude On Mon, Jun 27, 2011 at 10:29 PM, vaibhav agarwal vibhu.bitspil...@gmail.com wrote: @radha: hw abt using a fixed size circular list? On Sat, Jun 25, 2011 at 8:25 PM, radha krishnan radhakrishnance...@gmail.com wrote: simple!!  Stack:P On Sat, Jun 25,

[algogeeks] MS

2011-06-27 Thread Akshata Sharma
you are given a system of passing binary trees among 2 ppl Step1: convert the tree to preorder and inorder strings Step2:send those strings to the intended person Step3:get back tree from the strings whats your strategy of testing?write various test scenarios. -- You received this message

Re: [algogeeks] Reverse

2011-06-27 Thread hary rathor
@vishal : dont you think that , i is also a variable? -- 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

Re: [algogeeks] Office Suite

2011-06-27 Thread vaibhav agarwal
@radha k but i think we need to store the bottom of the stack for deleting the last node in O(1). as we can click the redo or undo fixed number of times and we would need two stacks is that ok. On Mon, Jun 27, 2011 at 10:31 PM, radha krishnan radhakrishnance...@gmail.com wrote: You asked the

Re: [algogeeks] Reverse

2011-06-27 Thread sameer.mut...@gmail.com
guys temporary variable means not to store string in another variable. On Mon, Jun 27, 2011 at 10:37 PM, hary rathor harry.rat...@gmail.comwrote: @vishal : dont you think that , i is also a variable? -- You received this message because you are subscribed to the Google Groups Algorithm

Re: [algogeeks] Re: puzzle

2011-06-27 Thread Bhavesh agrawal
only ONE mouse ...consume each sample of bottles of bear with a difference of one hour and calculate time.. sry if is thr any stupidity in this answer..but i think it may be right -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] Re: O(n) Time is the problem. ..

2011-06-27 Thread sunny agrawal
@saket - No O(n) + O(n/2) + O(n/4)... = O(n) sum of series n+n/2+n/4+n/8 = 2n On Mon, Jun 27, 2011 at 9:26 PM, Sanket vasa.san...@gmail.com wrote: @Dave - Wouldn't your solution also become O(kn) where k = number of bits in the number? In this summation - O(n) +

Re: [algogeeks] Re: puzzle

2011-06-27 Thread sunny agrawal
@Bhavesh NO there is No stupity just a mistake in reading the question mice die within 14 hrs.Not exactly 14 hours :) 3 is correct answer. On Mon, Jun 27, 2011 at 10:51 PM, Bhavesh agrawal agr.bhav...@gmail.comwrote: only ONE mouse ...consume each sample of bottles of bear with a

Re: [algogeeks] Re: puzzle

2011-06-27 Thread Bhavesh agrawal
ok , yeah 3 is the correct answer .. -- 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

[algogeeks] Re: MS question

2011-06-27 Thread Dave
@Nishant: Here are a couple of O(n) alternatives, given that there are a limited number of last characters and no requirement to break ties in any particular way: 1. A counting sort. 2. Form a linked list of entries corresponding to each last character, and then merge these lists in collating

Re: [algogeeks] Re: spoj shlights

2011-06-27 Thread kartik sachan
HEY DUDE I AM NOT GETTING UR LOGIC AT ALL I THINK HOW U WILL SATISFY THIS CASE GBGBBB -- 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

[algogeeks] Re: given a bst and a value x.find pair of nodes in the tree that sum upto x

2011-06-27 Thread Dave
@Swathi: No. I think the high level description should be adequate for you to write your own code or pseudocode, albeit recognizing that you may have to look up how to do an inorder traversal using a stack instead of recursion. Dave On Jun 27, 9:34 am, Swathi chukka.swa...@gmail.com wrote:

Re: [algogeeks] Re: given a bst and a value x.find pair of nodes in the tree that sum upto x

2011-06-27 Thread Swathi
Dave, I am unable to write code for this so i am asking your help. Thanks, Swathi On Mon, Jun 27, 2011 at 11:28 PM, Dave dave_and_da...@juno.com wrote: @Swathi: No. I think the high level description should be adequate for you to write your own code or pseudocode, albeit recognizing that you

Re: [algogeeks] Reverse

2011-06-27 Thread hary rathor
this solution according to sameer statement solution if there is any problem then pls tell me . here string or char is not being store anywhere char * reverse(char *str,int i ,int j) { while(ij) { str[i]=str[i]^str[j]; str[j]=str[i]^str[j]; str[i]=str[i]^str[j]; i++;j--; } return str; } int

Re: [algogeeks] Reverse

2011-06-27 Thread Swathi
it works perfectly On Mon, Jun 27, 2011 at 11:53 PM, hary rathor harry.rat...@gmail.comwrote: this solution according to sameer statement solution if there is any problem then pls tell me . here string or char is not being store anywhere char * reverse(char *str,int i ,int j) {

[algogeeks] Re: Yahoo Question

2011-06-27 Thread priyanshu
anyone!!! On Jun 23, 3:28 pm, Priyanshu priyanshuro...@gmail.com wrote: You have 100 computers, connected with each other. Give the most efficient way to design a web crawler, which will crawl most pages in least amount of time. Thanks, Priyanshu. -- You received this message because you

[algogeeks] c/c++ : STREAM PROBLEM

2011-06-27 Thread hary rathor
if i am design algo which specify to not use the extra memory then if i use the streams . then is it consider as a extra memory? -- Harish Pranami Master Of Computer Application , Deptt of computer Science, north campus , university of delhi, New Delhi pin no - 110007 -- You received this

Re: [algogeeks] Anyone have The google resume book

2011-06-27 Thread hary rathor
very funny ! every one know this site swathi -- 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

Re: [algogeeks] Re: given a bst and a value x.find pair of nodes in the tree that sum upto x

2011-06-27 Thread Piyush Sinha
how about converting the BST into a doubly linked list...but this will definitely modify the BST.. On Mon, Jun 27, 2011 at 11:32 PM, Swathi chukka.swa...@gmail.com wrote: Dave, I am unable to write code for this so i am asking your help. Thanks, Swathi On Mon, Jun 27, 2011 at 11:28 PM,

Re: [algogeeks] Re: spoj shlights

2011-06-27 Thread vaibhav agarwal
@kartik yup frgt to mention the last case 1 followed by zero's in that case number of iterations is the no. of trailing zeroes. GBGBBB will have four iterations 101000 = 1(one zero b/w two ones) + 3(last 1 followed by 3 zero's) BGBGBB,BBGBGB,BBBGBG,GG well logic is how hw mny jump of 1's u

Re: [algogeeks] Re: spoj shlights

2011-06-27 Thread vaibhav agarwal
@kartik also consider the case of GB the answer is 1 BG. ie trailing G's left. BGB leading B's left hence only one G followed by B therefore only one iteration. try out some cases u will find hw it wrks. On Tue, Jun 28, 2011 at 12:42 AM, vaibhav agarwal vibhu.bitspil...@gmail.com

Re: [algogeeks] Anyone have The google resume book

2011-06-27 Thread radha krishnan
+1 :P On Tue, Jun 28, 2011 at 12:27 AM, hary rathor harry.rat...@gmail.com wrote: very funny ! every one know this site swathi -- 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.

[algogeeks] Jr QA Analysts || 6 + months Contract || Columbus OH || $26-30/hr on C2C all inc

2011-06-27 Thread Steven Smith
Hi, Please find the following requirement and send me your consultant resume with the following details. Name: Contact: Current Location: Relocation: Rate: Job Title : Jr QA Analysts Duration:6 + months Contract Location : Columbus OH Rate : $26-30/hr on C2C all inc **CANDIDATES

[algogeeks] SAP Project Manager || San Jose, CA || 6+ months Contract

2011-06-27 Thread Steven Smith
Hi, Please find the following requirement and send me your consultant resume with the following details. Name: Contact: Current Location: Relocation: Rate: Position : SAP Project Manager Location : San Jose, CA Duration : 6+ months Contract * * *SAP PM with Finance modules experience + M+A

[algogeeks] Re: NEED ALGO IN TIME 0.00

2011-06-27 Thread Dumanshu
@Rizwan: don't u think for the counting sort part, if u use 11 int array as it is without copying values in the main array, it would run faster? And later on, get the sum from the two 11 int arrays like I did. Although m using a single buffer so m getting 0.01. -http://ideone.com/lsK8n So, by

[algogeeks] novel written test

2011-06-27 Thread amit the cool
Conversation between two mathematicians: first : I have three children. The product of their ages is 36 . If you sum their ages . it is exactly same as my neighbor's door number on my left. The second mathematician verifies the door number and says that the not sufficient . Then the first says

Re: [algogeeks] novel written test

2011-06-27 Thread Piyush Sinha
1,6,6 On Tue, Jun 28, 2011 at 2:07 AM, amit the cool amitthecoo...@gmail.comwrote: Conversation between two mathematicians: first : I have three children. The product of their ages is 36 . If you sum their ages . it is exactly same as my neighbor's door number on my left. The second

[algogeeks] novel written test

2011-06-27 Thread amit the cool
A chain is broken into three pieces of equal lengths containing 3 links each. It is taken to a back smith to join into a single continuous one . How many links are to be opened to make it ? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To

Re: [algogeeks] novel written test

2011-06-27 Thread amit kumar
@piyush..will u xplain plz. by d way 2 sons cant hav d same age(hope they r nt twins) On Tue, Jun 28, 2011 at 2:14 AM, Piyush Sinha ecstasy.piy...@gmail.comwrote: 1,6,6 On Tue, Jun 28, 2011 at 2:07 AM, amit the cool amitthecoo...@gmail.comwrote: Conversation between two mathematicians:

Re: [algogeeks] novel written test

2011-06-27 Thread udit sharma
Since the product of their ages is 36. So the possible combination of ages may b: either 1 4 9 or 4 3 3 6 6 1 1 2 18 1 3 12 1 1 36 2 2 9 Now neighbor's door numbr gives the sum.. Here all gives uniq sum except (sum=13) So there will be doubt in either 6 6 1 or 2 2 9 Bt as mathematician said tat

Re: [algogeeks] novel written test

2011-06-27 Thread gmagog...@gmail.com
Is it required that no two sons have the same age? From my view, the clue my youngest is the youngest only defines the requirement that the youngest one is unique, but he can still have two older brothers of the same age. Please correct me if this is wrong. Yanan Cao On Mon, Jun 27, 2011 at

Re: [algogeeks] novel written test

2011-06-27 Thread Piyush Sinha
We just need to look the 3 set of number that multiply to 36... the set can be as (1,1,36),(1,2,18),(1,4,9)..(1,6,6),(1,3,12)..(2,2,9) The catch here is we need not find the whole set...the second mathematician can't guess their ages through their sum that means there are at least

Re: [algogeeks] novel written test

2011-06-27 Thread sourabh jakhar
two On Tue, Jun 28, 2011 at 2:23 AM, amit the cool amitthecoo...@gmail.comwrote: A chain is broken into three pieces of equal lengths containing 3 links each. It is taken to a back smith to join into a single continuous one . How many links are to be opened to make it ? -- You received

Re: [algogeeks] novel written test

2011-06-27 Thread gmagog...@gmail.com
if( links can be melt and made into smaller links ) { return 1; } else { return 2; } Yanan Cao On Mon, Jun 27, 2011 at 4:09 PM, sourabh jakhar sourabhjak...@gmail.comwrote: two On Tue, Jun 28, 2011 at 2:23 AM, amit the cool amitthecoo...@gmail.comwrote: A chain is broken into

Re: [algogeeks] novel written test

2011-06-27 Thread amit kumar
how 2?? On Tue, Jun 28, 2011 at 2:40 AM, gmagog...@gmail.com gmagog...@gmail.comwrote: if( links can be melt and made into smaller links ) { return 1; } else { return 2; } Yanan Cao On Mon, Jun 27, 2011 at 4:09 PM, sourabh jakhar sourabhjak...@gmail.comwrote: two On

Re: [algogeeks] novel written test

2011-06-27 Thread amit kumar
ok piyush..u r right.well done On Tue, Jun 28, 2011 at 2:31 AM, Piyush Sinha ecstasy.piy...@gmail.comwrote: We just need to look the 3 set of number that multiply to 36... the set can be as (1,1,36),(1,2,18),(1,4,9)..(1,6,6),(1,3,12)..(2,2,9) The catch here is we need not

Re: [algogeeks] Re: O(n) Time is the problem. ..

2011-06-27 Thread aditya kumar
@Kamakshi.thnks.i dint realise that. On Mon, Jun 27, 2011 at 11:04 PM, sunny agrawal sunny816.i...@gmail.comwrote: @saket - No O(n) + O(n/2) + O(n/4)... = O(n) sum of series n+n/2+n/4+n/8 = 2n On Mon, Jun 27, 2011 at 9:26 PM, Sanket vasa.san...@gmail.com

Re: [algogeeks] Re: O(n) Time is the problem. ..

2011-06-27 Thread Anand
http://anandtechblog.blogspot.com/2011/06/google-question-find-missing-number.html On Mon, Jun 27, 2011 at 4:12 PM, aditya kumar aditya.kumar130...@gmail.comwrote: @Kamakshi.thnks.i dint realise that. On Mon, Jun 27, 2011 at 11:04 PM, sunny agrawal sunny816.i...@gmail.comwrote: @saket -

Re: [algogeeks] Re: Statement Riddle

2011-06-27 Thread varun pahwa
*'Ferari driver' easily beats the 'force indain driver'.* *'force indain drive' had outdone the 'ferari driver'. Now second statement says force indian drive outdone the ferari driver (who is a man who must have run/walked).* On Mon, Jun 27, 2011 at 9:09 AM, Vishal Thanki

[algogeeks] Queue using a stack

2011-06-27 Thread Ashish Goel
Hi, The implementation is simple using 2 stacks, however we also need to make sure that if queue length is say x, we are able to enqueue x elements. As per my understanding, i could think of the solution using 4 stacks instead of 2(1 for enqueue, 1 for dequeue, 1 aux for enqueue, 1 aux for

[algogeeks] PUZZLE

2011-06-27 Thread Bhavesh agrawal
All the nine digits are arranged here so as to form four square numbers: 9 81 324 576 How would you put them together so as to form single smallest possible square number and a single largest possible square number.. 139854276 and 923187456 are the answers given

Re: [algogeeks] Re: Sherlock puzzle 24 June

2011-06-27 Thread sagar pareek
It was due to finish of oxygen inside the car.as it was sealed with closed door and windows On Sat, Jun 25, 2011 at 8:59 PM, sarveswaran v sarveswar...@gmail.comwrote: she might have died because of heat generated inside the closed car On Jun 24, 3:05 am, Lavesh Rawat

[algogeeks] Re: PUZZLE

2011-06-27 Thread Dave
@Bhavesh: Check the squares of the integers from ceiling(sqrt(123456789)) to floor(sqrt(987654321)) to see which ones contain all nine nonzero digits. Since the sum of the nine nonzero digits is 45, a satisfactory square will be a multiple of 9, and therefore, we only need consider the squares of

[algogeeks] Re: PUZZLE

2011-06-27 Thread Dave
Replying to myself, I should have printed i*i instead of i near the end of the code: printf(%i\n,i*i); Dave On Jun 27, 11:47 pm, Dave dave_and_da...@juno.com wrote: @Bhavesh: Check the squares of the integers from ceiling(sqrt(123456789)) to floor(sqrt(987654321)) to see which ones contain

  1   2   >