Re: [algogeeks] apti!

2011-08-26 Thread Dheeraj Sharma
ans is 20 *Stop Cramming Start Thinking* -- *Dheeraj Sharma* Comp Engg. NIT Kurukshetra +91 8950264227 -- 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 th

Re: [algogeeks] maximum XOR

2011-08-26 Thread wujin chen
refer to this : http://discuss.joelonsoftware.com/default.asp?interview.11.614716 2011/8/27 jai gupta > @Neha take 42, 21 and 1 > > 42 ^ 1 =43 > while 42 ^21 =63 > > > > On Fri, Aug 26, 2011 at 10:28 PM, Neha Singh > wrote: > >> Sort the nos., which can be done in O(nlogn) >> Now the 1st and th

[algogeeks] Sandisk interview process ??

2011-08-26 Thread siva viknesh
hi If anyone attended interview from this company .. kindly share the questions and experiences.for CSE group what kind of ques they ask?? .. Do they ask electronics ques also for CSE ppl ?plz share -- You received this message because you are subscribed to the Google Groups "Al

[algogeeks] Re: microsoft

2011-08-26 Thread siva viknesh
hi search this group.. u ll get lot of interview ques recently attended for ms On Aug 27, 10:58 am, rahul sharma wrote: > i joined this group yesterday...dATS y i posted..after psoting i > search for this but i got only questions n not the process... > thnx moiz 4 ur unfo. > > On Aug 27, 9:40 am

[algogeeks] Athena Health care

2011-08-26 Thread siva viknesh
hi If anyone attended interview from this company .. kindly share the questions and experiences. -- 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 thi

[algogeeks] Re: Suggestion

2011-08-26 Thread siva viknesh
go through geeksforgeeks.org ... tat will give u a clear idea with perfect explanations rather than reading these books On Aug 27, 12:07 am, ankit arun wrote: > Ya sure... :) > After posting it Igot even more confused... > > On Sat, Aug 27, 2011 at 9:33 AM, siddharth srivastava > wrote: > > > >

Re: [algogeeks] maximum XOR

2011-08-26 Thread Dheeraj Sharma
brute force :P On Sat, Aug 27, 2011 at 10:22 AM, Sanjay Rajpal wrote: > +1 t jai. > > > Sanju > :) > > > > On Fri, Aug 26, 2011 at 9:46 PM, raj kumar wrote: > >> good test case jai >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >

[algogeeks] Re: Rotating 1D array clockwise

2011-08-26 Thread DheerajSharma
actually i was so involved in the question..that i forgot to see..wether its clockwise or not ;) thanks for the solution On Aug 27, 10:56 am, Sanjay Rajpal wrote: > u have mentioned clockwise, but o/p u r giving is anti-clock wise. > > solution for clockwise : > > See Reverse last k and first n-k

Re: [algogeeks] Rotating 1D array clockwise

2011-08-26 Thread Dheeraj Sharma
oh yeah..sorry ;) n thanks for the solution :) On Sat, Aug 27, 2011 at 11:26 AM, Sanjay Rajpal wrote: > u have mentioned clockwise, but o/p u r giving is anti-clock wise. > > solution for clockwise : > > See Reverse last k and first n-k numbers e.g. > 5 4 3 2 1 8 7 6 > > now reverse whole array.

[algogeeks] Re: microsoft

2011-08-26 Thread rahul sharma
i joined this group yesterday...dATS y i posted..after psoting i search for this but i got only questions n not the process... thnx moiz 4 ur unfo. On Aug 27, 9:40 am, raj kumar wrote: > please search for an older post for the topic before posting anything > there's already a post on this topis >

Re: [algogeeks] Rotating 1D array clockwise

2011-08-26 Thread Sanjay Rajpal
u have mentioned clockwise, but o/p u r giving is anti-clock wise. solution for clockwise : See Reverse last k and first n-k numbers e.g. 5 4 3 2 1 8 7 6 now reverse whole array. 6 7 8 1 2 3 4 5. solution for anti-clockwise : See Reverse first k and last n-k numbers e.g. 3 2 1 8 7 6 5 4 now r

[algogeeks] Rotating 1D array clockwise

2011-08-26 Thread Dheeraj Sharma
How to rotate 1d array of length clockwise 'k' times?? (1,2,3,4,5,6,7,8)->(4,5,6,7,8,1,2,3) for k=3 n= 8 Give solutions which do not swap the array k times!! i.e less than O(nk) -- *Dheeraj Sharma* Comp Engg. NIT Kurukshetra +91 8950264227 -- You received this message because you are subscribe

Re: [algogeeks] stack using bst

2011-08-26 Thread shady
exactly try posting links to the problem... On Sat, Aug 27, 2011 at 10:33 AM, raj kumar wrote: > Please mention the source of the question when you ask such question to > confirm that a solution exists for this prob. > > -- > You received this message because you are subscribed to the Google

Re: [algogeeks] stack using bst

2011-08-26 Thread raj kumar
Please mention the source of the question when you ask such question to confirm that a solution exists 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 unsubscr

[algogeeks] AMERICAN EXPRESS

2011-08-26 Thread mani walia
Guys american express coming to our college for training. Plz anyone who has faced the written test and procedure.. please share their views.. it wud be helpful for us.. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group,

Re: [algogeeks] Re: PLz help urgent

2011-08-26 Thread mani walia
i also want to know buddy.. if u knw thn help me buddy On Thu, Aug 25, 2011 at 11:01 PM, vivek wrote: > hello buddy...hows u...american express > also cuming to our campus,..have u got any info abt its > technical written and apti written test tha

Re: [algogeeks] maximum XOR

2011-08-26 Thread Sanjay Rajpal
+1 t jai. Sanju :) On Fri, Aug 26, 2011 at 9:46 PM, raj kumar wrote: > good test case jai > > -- > 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 thi

Re: [algogeeks] maximum XOR

2011-08-26 Thread raj kumar
good test case jai -- 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

Re: [algogeeks] Re: microsoft

2011-08-26 Thread raj kumar
please search for an older post for the topic before posting anything there's already a post on this topis 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

[algogeeks] Re: microsoft

2011-08-26 Thread Moiz
there are basically 5 rounds which microsoft takes in on campus placements all are pure technical first round is basic wash off round technical, basic C second is algorithms round third is pure data structures and depth technical round fourth is technical interview and in fifth round comes (tech 7

[algogeeks] Re: microsoft

2011-08-26 Thread rahul sharma
does they take apti+technical in written or only pure technical in written??plz help me guysits really imp.thnx in advancce.. On Aug 26, 10:00 pm, Neha Gupta wrote: > college? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To p

Re: [algogeeks] Re: Find all the subsets whose sum <= k

2011-08-26 Thread rahul sharma
yeah i wen first post answer i said it is for finding sum=k; n just add one more condition in loop for finding wrote: > It's not knapsack in knapsack we find max or min subset here we have to > find all subsets <=k not just one which is min or max , so I guess we have > to form all subsets and ch

Re: [algogeeks] Re: Suggestion

2011-08-26 Thread ankit arun
Ya sure... :) After posting it Igot even more confused... On Sat, Aug 27, 2011 at 9:33 AM, siddharth srivastava wrote: > > > On 27 August 2011 08:48, ankit arun wrote: > >> thanks everybody for so many suggestions... :) > > > > so let us know when you finish all those :P > > >> >> >> On Sat, Aug

Re: [algogeeks] Re: Regarding my posts

2011-08-26 Thread siddharth srivastava
On 26 August 2011 08:37, Navneet wrote: > Though the problem mentioned was little on serious side, the thread > turner out to be really funny :) > now it seems that op is not receiving any posts :D > > On Aug 25, 10:31 pm, shady wrote: > > lol, then how did this one came ? > > > > On Thu, Au

Re: [algogeeks] Re: Suggestion

2011-08-26 Thread siddharth srivastava
On 27 August 2011 08:48, ankit arun wrote: > thanks everybody for so many suggestions... :) so let us know when you finish all those :P > > > On Sat, Aug 27, 2011 at 6:40 AM, Rahul wrote: > >> If the seeker wants to do entire self study , then I would suggest CS >> 106B Reader , it's in C +

Re: [algogeeks] Re: Suggestion

2011-08-26 Thread ankit arun
thanks everybody for so many suggestions... :) On Sat, Aug 27, 2011 at 6:40 AM, Rahul wrote: > If the seeker wants to do entire self study , then I would suggest CS > 106B Reader , it's in C ++ , BUT ideal for people who rely only on > internet. ALso that Data STructure USing C ,Book by Y. KAni

Re: [algogeeks] Re: unsorted array problem

2011-08-26 Thread raj kumar
@don really cool algo man -- 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

Re: [algogeeks] Re: Find all the subsets whose sum <= k

2011-08-26 Thread raj kumar
It's not knapsack in knapsack we find max or min subset here we have to find all subsets <=k not just one which is min or max , so I guess we have to form all subsets and check their sum hence the algoritm will be 0(2^n) where n is number of elements in the set , please correct me if i am wrong or

Re: [algogeeks] Re: puzzle

2011-08-26 Thread Anup Ghatage
Check this out: Tie it at the 200th meter mark. Throw the 150mt rope down. Climb down to the 100th meter pole. Tie the rope there from the middle, and not the end. So what you have is a 150 mt rope that is tied at 200 mt mark, 100 mt mark and 50 mts of the rope from 100 mt marks is hanging. Now

Re: [algogeeks] Re: Suggestion

2011-08-26 Thread Rahul
If the seeker wants to do entire self study , then I would suggest CS 106B Reader , it's in C ++ , BUT ideal for people who rely only on internet. ALso that Data STructure USing C ,Book by Y. KAnitikar , I never saw any math in any chapters for analysis of algorithms they write . lol. Google it

Re: [algogeeks] Re: puzzle

2011-08-26 Thread SuDhir mIsHra
i hope now it clear: [image: Screenshot.png] -- 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.

[algogeeks] Re: puzzle

2011-08-26 Thread icy`
Other than making little loops and risking the fall on the first trip down, I dont think the rope question has an answer. NVIDIA just wanted to see if you were suicidal =D On Aug 26, 3:36 pm, Piyush Grover wrote: > Cut the rope in 50mtrs and 100mtrs length. > > Make a small loop(of negligible

[algogeeks] Recruitment Procedure for Microsoft Research Redmond and Bangalore

2011-08-26 Thread shady
Does anyone know about the recruitment procedure for Research Intern at MS Redmond or MS Bangalore ? What are the type of questions do they ask and what should be paid attention to ? There are lot of posts on MS SDE and SDET positions but none about research. If anyone knows then kindly reply. --

Re: [algogeeks] Re: puzzle

2011-08-26 Thread Piyush Grover
Cut the rope in 50mtrs and 100mtrs length. Make a small loop(of negligible length at one end of the 50 mtrs rope) Tie the other end of the rope at the top and from the loop end side pass the 100mtrs rope such that you have both the ends of 100mtrs rope in your end. now get down at 100mtrs peg po

Re: [algogeeks] unsorted array problem

2011-08-26 Thread Rahul Verma
@Umesh I really appreciate your solution and thinking to understand the complexity of the program. Actually I don't have that much idea about the "*how to calculate complexity of any program*". So could you please show some light on the evaluation procedure of complexity. Rahul Verma -- You

[algogeeks] Re: Find all the subsets whose sum <= k

2011-08-26 Thread Don
The 0-1 knapsack problem is still the knapsack problem. Don On Aug 26, 1:55 pm, Piyush Grover wrote: > it's similar to knapsack but not the same. In knapsack, types of items are > limited and we play on the quantity of each item. > Here each element will come once in the subset. > > On Fri, Aug 2

[algogeeks] Re: puzzle

2011-08-26 Thread icy`
I hope you dont mind that I respond to the original question about the 6x6 matrix. As I understand it, all elements have to be either 1 or -1, and product of *every* row and *every* column is 1 => how many arrangements? Now a bunch of you seem to think(nxn) => 2^((n-1)^2) gives the answer

[algogeeks] SPOJ ACODE

2011-08-26 Thread kartik sachan
i am getting repeatdly WA in this question link is https://www.spoj.pl/problems/ACODE/ plzz provide me some test cases where my code fails. my code is # include # include int main() { while(1) { char a[50100]; scanf("%s",&a); int l1=

Re: [algogeeks] Re: Find all the subsets whose sum <= k

2011-08-26 Thread Piyush Grover
it's similar to knapsack but not the same. In knapsack, types of items are limited and we play on the quantity of each item. Here each element will come once in the subset. On Fri, Aug 26, 2011 at 11:49 PM, Don wrote: > @rahul > Your code will only find pairs which sum to k. The problem is to fi

Re: [algogeeks] Re: unsorted array problem

2011-08-26 Thread tech coder
@ Don exactly waht u write i wanted to say On Fri, Aug 26, 2011 at 11:52 AM, tech coder wrote: > @Tech: I'm not sure I understand your algorithm. Let's try it on > {1,1,2,2,3,4,5,5,6,6,7,7}. The two number occurring an odd number of > times are 3 and 4. We xor the numbers getting 7 = 111 in binar

Re: [algogeeks] Re: unsorted array problem

2011-08-26 Thread tech coder
@Tech: I'm not sure I understand your algorithm. Let's try it on {1,1,2,2,3,4,5,5,6,6,7,7}. The two number occurring an odd number of times are 3 and 4. We xor the numbers getting 7 = 111 in binary. Now how do we divide the numbers into two groups? see we come to know that both number differ at bi

Re: [algogeeks] apti!

2011-08-26 Thread priya ramesh
oh thanks :) It's given as 10 only. Printing mistake i guess. -- 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..

Re: [algogeeks] apti!

2011-08-26 Thread Piyush Grover
it's basic unitary method problem: x men do work in 10 days 1 man will do-in 10*x days x-10 men do it in 10*x/(x-10) = (10+10) Solve it and x = 20 it can't be 130 On Fri, Aug 26, 2011 at 11:53 PM, gmagog...@gmail.com wrote: > @Rahul > > Assume the productivity of each man is the same > > l

Re: [algogeeks] apti!

2011-08-26 Thread Sanjay Rajpal
If it is 10 days originally, answer is 20 for sure. Sanju :) On Fri, Aug 26, 2011 at 11:27 AM, Sanjay Rajpal wrote: > In this question, instead of 10, it is 100. > Check it again. > > > Sanju > :) > > > > On Fri, Aug 26, 2011 at 11:26 AM, Sanjay Rajpal wrote: > >> Sry for prrevious post .

Re: [algogeeks] apti!

2011-08-26 Thread Sanjay Rajpal
In this question, instead of 10, it is 100. Check it again. Sanju :) On Fri, Aug 26, 2011 at 11:26 AM, Sanjay Rajpal wrote: > Sry for prrevious post . > > It is question of R S Aggarwal, and solved using conecpt of direct and > indirect proportions. > > Originally,let there be x men. > > Le

Re: [algogeeks] apti!

2011-08-26 Thread Sanjay Rajpal
Sry for prrevious post . It is question of R S Aggarwal, and solved using conecpt of direct and indirect proportions. Originally,let there be x men. Less men,more days(indirect proposition) (x-10) : x :: 100 : 110 (x-10) * 110 = x * 100 ANS : x = 110 Sanju :) On Fri, Aug 26, 2011 at 11:2

Re: [algogeeks] apti!

2011-08-26 Thread gmagog...@gmail.com
@Rahul Assume the productivity of each man is the same let original number of man be x The total workload= x*10*p also workload = (x-10)(10+10)*p solve it so x=20 Yanan Cao On Fri, Aug 26, 2011 at 1:21 PM, Rahul Verma wrote: > @yanan how it is 20. > > Rahul Verma > > -- > You received thi

Re: [algogeeks] apti!

2011-08-26 Thread priya ramesh
the answer is 130 itseems. i too got 20 -- 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. Fo

Re: [algogeeks] apti!

2011-08-26 Thread Rahul Verma
@yanan how it is 20. Rahul Verma -- 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/-/uIONcvrf6kUJ. To post to this group, send email to algogeeks@googlegroups.

Re: [algogeeks] apti!

2011-08-26 Thread Sanjay Rajpal
20 men ? (x-10)20=10x Sanju :) On Fri, Aug 26, 2011 at 11:17 AM, gmagog...@gmail.com wrote: > 20? > > Yanan Cao > > > > On Fri, Aug 26, 2011 at 1:12 PM, priya ramesh < > love.for.programm...@gmail.com> wrote: > >> A certain number of men can finish a piece of work in 10 days. If however >> the

Re: [algogeeks] apti!

2011-08-26 Thread priya ramesh
i too got the same ans. -- 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,

[algogeeks] Re: Find all the subsets whose sum <= k

2011-08-26 Thread Don
@rahul Your code will only find pairs which sum to k. The problem is to find a subset of as many elements in the array as required to sum as close as possible to k. It is a well-known problem and after years of study, no polynomial solution is known. There are reasonably fast solutions for small in

Re: [algogeeks] apti!

2011-08-26 Thread gmagog...@gmail.com
20? Yanan Cao On Fri, Aug 26, 2011 at 1:12 PM, priya ramesh < love.for.programm...@gmail.com> wrote: > A certain number of men can finish a piece of work in 10 days. If however > there were 10 men less it will take 10 days more for the work to be > finished. How > many men were there originall

[algogeeks] apti!

2011-08-26 Thread priya ramesh
A certain number of men can finish a piece of work in 10 days. If however there were 10 men less it will take 10 days more for the work to be finished. How many men were there originally? (a) 110 men (b) 130 men (c) 100 men (d) none of these -- You received this message because you are subscribe

[algogeeks] Re: Find all the subsets whose sum <= k

2011-08-26 Thread rahul sharma
yes it will return in c return 1 value at tym... ijust given the code snipetjust modify it..store trhm in some other array like thebut it will On Aug 26, 11:02 pm, Piyush Grover wrote: > @rahul...I'm unsure if your algo returns all the subsets. > > On Fri, Aug 26, 2011 at 11:24 PM

[algogeeks] Re: unsorted array problem

2011-08-26 Thread Dave
@Tech, Don: How about this: given n and array a[n]: int x = 0, result[2] = {0}; for( i = 0 ; i < n ; ++i ) x ^= a[i]; x |= x&(x-1); // low order 1-bit of xor for( i = 0 ; i < n ; ++i ) result[a[i]&x?0:1] ^= a[i]; Dave On Aug 26, 12:49 pm, Don wrote: > I believe this is what techcoder is

Re: [algogeeks] Re: Find all the subsets whose sum <= k

2011-08-26 Thread Piyush Grover
@rahul...I'm unsure if your algo returns all the subsets. On Fri, Aug 26, 2011 at 11:24 PM, rahul sharma wrote: > yeah can be done in poly tym also...but we dnt knw whether we have > unsorted arryit is possible in sorted array. > > On Aug 26, 10:52 pm, Don wrote: > > This is the knapsack pro

Re: [algogeeks] Re: unsorted array problem

2011-08-26 Thread Sanjay Rajpal
XOR all the elements in the array, the result will be the XOR of the two numbers occuring odd number of times. Now take any set bit of th result(u can determine the position of any bit set in the number). Divide the array such that for the numbers for which at this location(where the bit is set in

[algogeeks] Re: Find all the subsets whose sum <= k

2011-08-26 Thread rahul sharma
yeah can be done in poly tym also...but we dnt knw whether we have unsorted arryit is possible in sorted array. On Aug 26, 10:52 pm, Don wrote: > This is the knapsack problem. > Find a polynomial-time solution and you will be a hero. > Don > > On Aug 26, 12:43 pm, Piyush Grover wrote: > > >

[algogeeks] Re: Find all the subsets whose sum <= k

2011-08-26 Thread Don
This is the knapsack problem. Find a polynomial-time solution and you will be a hero. Don On Aug 26, 12:43 pm, Piyush Grover wrote: > Here is a problem: > > Given an array of size n. Find all the MAXIMAL subsets whose sum is <= K. > The solution is not a concern, the optimization is required. > >

[algogeeks] Re: Find all the subsets whose sum <= k

2011-08-26 Thread rahul sharma
take h as array/has table as max element of a as size. just a psecudeocde. for(i=0;i wrote: > Here is a problem: > > Given an array of size n. Find all the MAXIMAL subsets whose sum is <= K. > The solution is not a concern, the optimization is required. > > -piyush -- You received this messag

[algogeeks] Re: unsorted array problem

2011-08-26 Thread Don
I believe this is what techcoder is saying: int a[N]; // Find the bitwise xor of all the array values. // These are the bits which are different between the two results. int xor = 0; for(i = 0; i < N; ++i) xor ^= a[N]; // Find the low order bit of xor int bit = 1; while(!(xor & bit)) bit <<=

[algogeeks] Find all the subsets whose sum <= k

2011-08-26 Thread Piyush Grover
Here is a problem: Given an array of size n. Find all the MAXIMAL subsets whose sum is <= K. The solution is not a concern, the optimization is required. -piyush -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send em

Re: [algogeeks] Samsung India Electronics Limited vs Winshuttle

2011-08-26 Thread Algo'nAlgo
And in my college , samsung is giving 6.25lpa whereas winshuttle 7lpa with dream status.. thats y a bit confused :O -- 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/alg

[algogeeks] Re: C Trick

2011-08-26 Thread Dave
@Rajesh: abs() can be done without conditional operations. There probably are many ways. The first two that come to mind are: abs(x) = (x >> 31) & x | ~(x >> 31) & ~x abs(x) = (x >> 31) ^ x + (x >> 31) & 1 Dave On Aug 26, 2:56 am, rajesh singarapu wrote: > abs function itself has a condition??

[algogeeks] Re: Playdom Interview ques

2011-08-26 Thread Navneet
The function of that flag would be to decide direction (bottom up or top down/ left to right or otherwise) On Aug 26, 6:15 pm, Navneet wrote: > Also for ques 1, instead of having four auxiliary functions, you can > have a variable flag for rows and cols functions being passed as param > and reduc

[algogeeks] Re: unsorted array problem

2011-08-26 Thread Dave
@Tech: I'm not sure I understand your algorithm. Let's try it on {1,1,2,2,3,4,5,5,6,6,7,7}. The two number occurring an odd number of times are 3 and 4. We xor the numbers getting 7 = 111 in binary. Now how do we divide the numbers into two groups? Dave On Aug 26, 11:09 am, tech coder wrote: > i

[algogeeks] Re: microsoft

2011-08-26 Thread rahul sharma
thaparit is 100% yet sure.but it is 99% sure.i wana prepare early... On Aug 26, 10:00 pm, Neha Gupta wrote: > college? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegrou

Re: [algogeeks] maximum XOR

2011-08-26 Thread jai gupta
@Neha take 42, 21 and 1 42 ^ 1 =43 while 42 ^21 =63 On Fri, Aug 26, 2011 at 10:28 PM, Neha Singh wrote: > Sort the nos., which can be done in O(nlogn) > Now the 1st and the last integers are the required integers. > > -- > You received this message because you are subscribed to the Google Group

Re: [algogeeks] microsoft

2011-08-26 Thread Neha Gupta
college? -- 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 grou

Re: [algogeeks] maximum XOR

2011-08-26 Thread Neha Singh
Sort the nos., which can be done in O(nlogn) Now the 1st and the last integers are the required integers. -- 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 thi

[algogeeks] Re: What is the output and how ???

2011-08-26 Thread rahul sharma
yeah...just clear concept of recursion...its simple form test ur c skilss..(function.) On Aug 26, 1:22 pm, kARTHIK R wrote: > Here is a simpler way to understand. > > fun(0) = prints nothing > fun(1) = f(0) + print 0 + fun(-1) = 0 > fun(2) = fun(1) + print 1 + fun (0) = 0 1 > fun(3) = fun(2) + pr

[algogeeks] microsoft

2011-08-26 Thread rahul sharma
hi guys...microsoft is coming to our campus..plz nyone tell their recruitment procedure..n give me their previous xams question if nyone has...but please tell me their selection procedure n roundscuming after 2 days.plz reply soon.n tell me the subjects to crack microsoft...

[algogeeks] maximum XOR

2011-08-26 Thread sukhmeet singh
Given n unsigned integer, output 2 integers which has the maximum result after XOR -- 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] array sum

2011-08-26 Thread sukhmeet singh
how to divide an integer array into 2 sub-arrays and make their averages equal? array is unsorted and we can also take any numbers and the numbers in the array need not be contiguous in the original array. how many total such array's are possible. Output them -- You received this message because

Re: [algogeeks] unsorted array problem

2011-08-26 Thread tech coder
it can be done in O(N) by using XOR ing the elements 1: Xor all the elemnts since those elemnts that even freq will nullify each other we get number taht will tell in which the two required number differ. 2: divide the array in two sets on the basis of bit in which numbers differ 3:1 element will

[algogeeks] Regarding Sandisk

2011-08-26 Thread NAGARAJAN SIVARAMAN
Do anyone have ideas regarding Sandisk technical and interview questions...?? or any link to refer..?? Thanks 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 unsu

[algogeeks] Re: Find the non-duplicate element in sorted array in < O(n) time

2011-08-26 Thread Don
After working on it quite a bit I got an O(log n) algorithm working. For small cases (size < 10) it sequentially finds the solution. For larger cases it uses a binary search: Starting at the midpoint, find the left and the right ends of the region with values equal to the value at the midpoint. T

Re: [algogeeks] is it possible to access data from memory location 0?

2011-08-26 Thread saurabh singh
0 is reserved as the address which can't be referenccd On Fri, Aug 26, 2011 at 9:08 PM, UTKARSH SRIVASTAV wrote: > i think it is reserved for system functions and you are not allowed to work > as your program is not alloted that area if somehow your program is allowed > that area there will be

[algogeeks] Re: Given a number, return the least prime greater than number

2011-08-26 Thread Don
Usually that is done before run time and hard coded into the hash function. But for numbers in the range you are talking about, a sieve would work. However trial division should not take long either, if you just need to do it once when the hash table is created. Don On Aug 25, 10:18 pm, Navneet G

[algogeeks] Tejas Network Placement Process!!!

2011-08-26 Thread rohit
Please share Process and experience of tejas Network for software profile. 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

Re: [algogeeks] chanege in immutable string

2011-08-26 Thread tech coder
thanks to all got it On Fri, Aug 26, 2011 at 4:54 AM, Neha Singh wrote: > @tech coder: > When u execute : s+="c c++"; > a new string object is created with the value of s appended with "c c++". > Now s is made to hold the reference of this new string object. Thus the > older string object is not

Re: [algogeeks] is it possible to access data from memory location 0?

2011-08-26 Thread UTKARSH SRIVASTAV
i think it is reserved for system functions and you are not allowed to work as your program is not alloted that area if somehow your program is allowed that area there will be no segmentation fault On Fri, Aug 26, 2011 at 7:57 AM, siddharam suresh wrote: > but its its valid address right > Th

Re: [algogeeks] Re: Suggestion

2011-08-26 Thread sukran dhawan
wat are u tying to say :P ? is that a good book or wat ? On Fri, Aug 26, 2011 at 7:55 PM, saurabh singh wrote: > Yayashwant kanitekar and deepali srivastava are great books > > If you find all the mistakes that they have made you have learned DS(and > coding style) quite well.:p > > On F

Re: [algogeeks] is it possible to access data from memory location 0?

2011-08-26 Thread siddharam suresh
but its its valid address right Thank you, Sid. On Fri, Aug 26, 2011 at 8:16 PM, SANDEEP CHUGH wrote: > no it results in segmentation fault > > On Fri, Aug 26, 2011 at 3:48 PM, siddharam suresh > wrote: > >> >> Thank you, >> Siddharam >> >> -- >> You received this message because you are

Re: [algogeeks] is it possible to access data from memory location 0?

2011-08-26 Thread SANDEEP CHUGH
no it results in segmentation fault On Fri, Aug 26, 2011 at 3:48 PM, siddharam suresh wrote: > > Thank you, > Siddharam > > -- > 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.

Re: [algogeeks] Re: puzzle

2011-08-26 Thread Naren s
varun: can u explain it little further.. On Wed, Aug 10, 2011 at 7:49 PM, varun pahwa wrote: > make two ropes 50m and 100 meter. make a loop kind of thing with that now > you have two 50 mtr ropes so get down to 100 mtr point and tie loop rope in > downward now cut the loop at 100 mtr you have 1

Re: [algogeeks] Re: Suggestion

2011-08-26 Thread saurabh singh
Yayashwant kanitekar and deepali srivastava are great books If you find all the mistakes that they have made you have learned DS(and coding style) quite well.:p On Fri, Aug 26, 2011 at 2:44 PM, Suraj Fale wrote: > A book by 'Yashwant Kanetkar' > > > On Fri, Aug 26, 2011 at 9:03 AM, Navn

Re: [algogeeks] Re: puzzle

2011-08-26 Thread Himanshu Srivastava
lol :P On Wed, Aug 10, 2011 at 11:35 PM, $hr! k@nth wrote: > Tie the rope at the top of the tower > Climb down with the help of the rope up to 100 mt peg possItion > Tie the rope to that peg, Climb up to the top of the tower with that rope. > Now release the rope at the top and hold it. It ll t

[algogeeks] Re: Playdom Interview ques

2011-08-26 Thread Navneet
Also for ques 1, instead of having four auxiliary functions, you can have a variable flag for rows and cols functions being passed as param and reduce the number to two. On Aug 26, 6:07 pm, Navneet wrote: > @Neha, > > For your solution of 1, you needed to take m*n matrix into account. > Though i

[algogeeks] Re: Playdom Interview ques

2011-08-26 Thread Navneet
@Neha, For your solution of 1, you needed to take m*n matrix into account. Though i think your approach should work fine even in that case. Function signature will change. For 3rd solution, the corner cases actually little non-trivial while writing code(need to consider root, root with no right s

Re: [algogeeks] Re: inorder predecessor

2011-08-26 Thread Sanjay Rajpal
got it Vikram :) Sanju :) On Fri, Aug 26, 2011 at 5:43 AM, Vikram Singh wrote: > i m writing just a pseudocode... > // root is the root of treeand node is the node whose > predecessor is to be found > > predecessor(root, node) > { > parent=NULL; > if(root==NULL) > return ; > > if(no

[algogeeks] Re: inorder predecessor

2011-08-26 Thread Vikram Singh
i m writing just a pseudocode... // root is the root of treeand node is the node whose predecessor is to be found predecessor(root, node) { parent=NULL; if(root==NULL) return ; if(node->left!=NULL) { // find max value in left subtree... } else { while(root!=NULL

Re: [algogeeks] Re: inorder predecessor

2011-08-26 Thread sukran dhawan
hmmm k On Fri, Aug 26, 2011 at 5:54 PM, Vikram Singh wrote: > ya thats one option but that gives ans in O(n), requires additional > memory... and unnecessarily finds for all which is not required... > my sol doesnt require any extra space i.e. in O(1) space... and also > in O(log n) time... > > t

Re: [algogeeks] Re: inorder predecessor

2011-08-26 Thread Sanjay Rajpal
Vikram : will u plz elaborate more on ur solution ? Sanju :) On Fri, Aug 26, 2011 at 5:24 AM, Vikram Singh wrote: > ya thats one option but that gives ans in O(n), requires additional > memory... and unnecessarily finds for all which is not required... > my sol doesnt require any extra space

[algogeeks] Re: inorder predecessor

2011-08-26 Thread Vikram Singh
ya thats one option but that gives ans in O(n), requires additional memory... and unnecessarily finds for all which is not required... my sol doesnt require any extra space i.e. in O(1) space... and also in O(log n) time... tell if dere is any missing case On Aug 26, 4:58 pm, sukran dhawan w

Re: [algogeeks] Re: Reverse dutch flag problem

2011-08-26 Thread sukran dhawan
count no of 0s,1s and 2s.fill first 0s followed by 1s den 2s :) On Thu, Aug 25, 2011 at 11:37 PM, icy` wrote: > not enough information, imo. Tell me more about the given string... > is the string made up of consecutive integers/characters ? Are there > always the same number of each character

Re: [algogeeks] inorder predecessor

2011-08-26 Thread sukran dhawan
is it not possible to traverse tree in order and store in array. then figure out the element and print the previous element? On Fri, Aug 26, 2011 at 2:04 PM, Vikram Singh wrote: > i figured out algo to find the inorder predecessor of a bst without > using parent pointer... just wanna confirm if i

Re: [algogeeks] chanege in immutable string

2011-08-26 Thread Neha Singh
@tech coder: When u execute : s+="c c++"; a new string object is created with the value of s appended with "c c++". Now s is made to hold the reference of this new string object. Thus the older string object is not modified, but a new string string object is created. -- You received this message

Re: [algogeeks] Re: Playdom Interview ques

2011-08-26 Thread Neha Singh
For ques 2: ./*Function to print level order traversal of tree*/ printLevelorder(tree) for d = 1 to height(tree) { printGivenLevel(tree, d); printf(" %d\n",d); } /*Function to print all nodes at a given level*/ printGivenLevel(tree, level) if tree is NULL then return; if level is

  1   2   >