Re: [algogeeks] logic error:

2011-06-06 Thread Logic King
How can you assume that team name cannot be other than these.where in the question is written that only these teams will constitute the last 16. i hope you got my point and your mistake as well !! On Mon, Jun 6, 2011 at 4:28 AM, PRAMENDRA RATHi rathi prathi...@gmail.comwrote: no, i am

Re: [algogeeks] MS Question

2011-06-02 Thread Logic King
I Think circular DLL should do...skip list is not required !! On Thu, Jun 2, 2011 at 5:31 AM, Ashish Goel ashg...@gmail.com wrote: wouldn't it be skip list or a circular DLL what if we have next as well as next-next pointers in every node. If the LL is say a-bcd if a-b is corrupted, a-c can

Re: [algogeeks] MS Question

2011-06-02 Thread Logic King
, 2011 at 6:35 PM, Logic King crazy.logic.k...@gmail.comwrote: I Think circular DLL should do...skip list is not required !! On Thu, Jun 2, 2011 at 5:31 AM, Ashish Goel ashg...@gmail.com wrote: wouldn't it be skip list or a circular DLL what if we have next as well as next-next pointers

Re: [algogeeks] [brain teaser ] Trap Door puzzle 1 April

2011-06-01 Thread Logic King
nice one :) On Wed, Jun 1, 2011 at 12:49 AM, Naveen Kumar naveenkumarve...@gmail.comwrote: Wait till night and walk through the first door. On Wed, Jun 1, 2011 at 12:44 PM, Lavesh Rawat lavesh.ra...@gmail.comwrote: *Trap Door puzzle * * * ** *A man is trapped in a room. The room has

Re: [algogeeks] [brain teaser ] Trolls Riddle 31 may

2011-05-31 Thread Logic King
simple2 cakes ! On Tue, May 31, 2011 at 1:17 AM, Naveen Kumar naveenkumarve...@gmail.comwrote: 2 cakes. On Tue, May 31, 2011 at 12:48 PM, Lavesh Rawat lavesh.ra...@gmail.comwrote: *Trolls Riddle * * * ** *You are on your way to visit your Grandma, who lives at the end of the

Re: [algogeeks] Finding circle areas under dust bins

2011-05-31 Thread Logic King
If the number of people is large then putting the dustbin in hexagonal fashion as we do in mobile networks should minimize the number of dustbin ... On Tue, May 31, 2011 at 9:35 AM, ross jagadish1...@gmail.com wrote: -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] SPOJ Problem Help

2011-05-28 Thread Logic King
@sukhmeetyour code is having runtime error !! On Sat, May 28, 2011 at 4:48 AM, sukhmeet singh sukhmeet2...@gmail.comwrote: follow what Akash said..!! in case you still need help just go through http://ideone.com/al0U0 in devcpp..!! On Sat, May 28, 2011 at 2:34 PM, Aakash Johari

Re: [algogeeks] Google Interview Question

2011-05-27 Thread Logic King
i agree with piyush...can't find the countercase...satisfied with the algo. On Fri, May 27, 2011 at 6:58 AM, Piyush Sinha ecstasy.piy...@gmail.comwrote: how about adding zeroes at the end of integers to make to equal to the integer with maximum number of digits and sort them... ex- 101 10

Re: [algogeeks] Re: Google Interview Question

2011-05-27 Thread Logic King
@sunny it will work fine if you have 2 numbers only...but what about the list...3..4 or 5..or morethen the possible number of combinations will be 'N!'...where n is the number of digits...the code will work quite slowly for larger 'n'. On Fri, May 27, 2011 at 3:33 PM, Dave

Re: [algogeeks] ms ques

2011-05-27 Thread Logic King
http://samples.msdn.microsoft.com/ietestcenter/ On Fri, May 27, 2011 at 9:40 AM, radha krishnan radhakrishnance...@gmail.com wrote: Check whether this is storing Google Search Results ? ? ?? ? ? ? ? ?? [HONEY POTTING] On Fri, May 27, 2011 at 10:07 PM, UTKARSH SRIVASTAV

Re: [algogeeks] Odd Even Sort array

2011-05-27 Thread Logic King
@ross i can do it in O(n) time using an extra array of the same size as the given array first sort both the even indexed terms and odd indexed terms by modifying quick sort...it can be done in one traversal. and then using extra array and then move the even indexed terms followed by odd

Re: [algogeeks] Re: Spoj Problem Help

2011-05-24 Thread Logic King
@aakash the cases are clear but can you explain how you did the matrix exponentiation part ??..explain plz...i'm not getting it... On Tue, May 24, 2011 at 1:25 AM, Aakash Johari aakashj@gmail.comwrote: It's done. Today I tried it. Simply for N=0 and N=1 answer is (0,0) = 0 and (1,1)=2

Re: [algogeeks] A SIMPLE C++ PROGRAM.

2011-05-03 Thread Logic King
What about the people explaining the answer above as '12'saying processing will start from left in cout and write in printf ?? On Sun, May 1, 2011 at 1:33 AM, Amit Jaspal amitjaspal...@gmail.com wrote: This is compiler dependent..and not a portable way of writing code On Sat,

Re: [algogeeks] Re: imporatnt(need help)

2011-04-28 Thread Logic King
@utkarsh that's very rude...you can't say about anyone like this.who knows you may be writing the man pages in the future :P On Thu, Apr 28, 2011 at 10:21 AM, UTKARSH SRIVASTAV usrivastav...@gmail.com wrote: i think mca students need to first study and then try to answer people like

Re: [algogeeks] spoj problem

2011-03-15 Thread Logic King
but int does not have such range then how it is accepted On Sat, Mar 12, 2011 at 7:57 PM, Logic King crazy.logic.k...@gmail.comwrote: Here is my solution.i got it AC #includestdio.h int gcd(int a, int b) { int temp; while(b) { temp = a % b; a = b

Re: [algogeeks] Re: Spoj Problem : String based

2011-03-14 Thread Logic King
I don't Know what's KMP algorithm..i am just trying to solve this problem on my own On Tue, Mar 15, 2011 at 1:55 AM, ritu ritugarg.c...@gmail.com wrote: Could you please explain ..whts the difference b/w KMP Algorithm and This problem. KMP also finds all occurrences of a string

[algogeeks] Spoj Problem : String based

2011-03-13 Thread Logic King
I tried the problem https://www.spoj.pl/problems/NHAY/ I didn't Understand the Input of the problem -- The length of the needle is only limited by the memory available to your program, so do not make any assumptions - instead, read the length and allocate memory as needed. The haystack is *not*

Re: [algogeeks] Spoj Problem : String based

2011-03-13 Thread Logic King
sukhmeet2...@gmail.comwrote: in order to deal with such situations u have to read the input till the end of file if your algo is correct then using EOF something like while(scanf(%d,n)!=EOF) will give u AC..!! On Sun, Mar 13, 2011 at 2:01 PM, Logic King crazy.logic.k...@gmail.comwrote: I tried

Re: [algogeeks] spoj problem

2011-03-12 Thread Logic King
Here is my solution.i got it AC #includestdio.h int gcd(int a, int b) { int temp; while(b) { temp = a % b; a = b; b = temp; } return(a); } int main() { int n,i,min,ans=0; scanf(%d,n); int arr[n],ard[n]; ard[0]=1; if(n0)

Re: [algogeeks] SPOJ DP : SUMITR

2011-03-08 Thread Logic King
the reason for this then please share it Thank you, Logic King On Mon, Mar 7, 2011 at 8:25 PM, Wladimir Tavares wladimir...@gmail.comwrote: This my code: #include stdio.h #define R(i,b) for(i=0;ib;i++) #define D(i,a) for(i=a;i=0;i--) #define I(d) scanf(%d,d); main(){int t,n,i,j,m[100][100];I(t

Re: [algogeeks] SPOJ DP : SUMITR

2011-03-08 Thread Logic King
++ 4.3 and above On Tue, Mar 8, 2011 at 10:42 PM, Logic King crazy.logic.k...@gmail.comwrote: Well tried, i have got the correct answer after working on it for almost 2 hours here is my code #includeiostream using namespace std;int a[100][100];main(){int t,n,i,j;cint;while(t--){cinn

Re: [algogeeks] SPOJ PROBLEM

2011-03-06 Thread Logic King
wrote: where is dp in your code ? btw, there is a spoj forum, you should search over there and you will get the required test cases where your code fails. Cheers! On Sat, Mar 5, 2011 at 11:45 PM, Logic King crazy.logic.k...@gmail.comwrote: i tried to solve the problem on spoj https

[algogeeks] Re: SPOJ Problem

2011-03-06 Thread Logic King
Has anyone solve this problem ?? On Fri, Mar 4, 2011 at 11:18 PM, Logic King crazy.logic.k...@gmail.comwrote: I am trying to solve the problem https://www.spoj.pl/problems/PHRASES/ but i am not getting how to approach the problem plz help me !! -- You received this message because

[algogeeks] SPOJ PROBLEM

2011-03-05 Thread Logic King
i tried to solve the problem on spoj https://www.spoj.pl/problems/TRT/ the problem is based on DP i coded the problem as #includeiostream #includealgorithm #includecstdio int arr[2000]; int main() { int i,l,r,age=1,n,sum=0; scanf(%d,n); l=0,r=n-1; for(i=0;in;i++)

Re: [algogeeks] printing without loop

2011-03-01 Thread Logic King
yes..the solution given by sunny is awesome...well done !! On Tue, Mar 1, 2011 at 6:25 PM, priya mehta priya.mehta...@gmail.comwrote: @sunny This is awesome On Tue, Mar 1, 2011 at 6:25 PM, priya mehta priya.mehta...@gmail.comwrote: This is awesome On Tue, Mar 1, 2011 at 1:27 PM,

Re: [algogeeks] making a graphical c++ programme

2011-02-25 Thread Logic King
I also want to know how to start making graphical program in c++..also can we integrate database with a c++ application. actually i want to make a c++ application using both c++ and databasehow should i start please guide me !!! On Sat, Feb 26, 2011 at 1:20 AM, UTKARSH SRIVASTAV

Re: [algogeeks] Re: SPOJ PROBLEM

2011-02-04 Thread Logic King
@juver++ thanks, learned about Unicode today !! On Fri, Feb 4, 2011 at 12:48 PM, juver++ avpostni...@gmail.com wrote: It is unicode I think. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

[algogeeks] BISHOPS

2011-02-04 Thread Logic King
please help me solve the problem on SPOJ https://www.spoj.pl/problems/BISHOPS/ The logic of the problem is very easy i.e. 2*n-2 but i am getting WA bcoz i am not able to deal with the large inputs.[?] plz help me how to get this AC. #includestdio.h int main() { long long int

[algogeeks] Easy problem but unable to handle large input

2011-02-04 Thread Logic King
Now,this is a very basic and very easy problem on SPOJ but again i failed to handle large inputs..someone please help me to get this AC https://www.spoj.pl/problems/JULKA/ My code which gave wrong answer is--- #includestdio.h int main() { long long int k,n,i,x1,x2;

Re: [algogeeks] Re: SPOJ PROBLEM

2011-02-03 Thread Logic King
@juver++ Is the sign you printed anywhere on keyboard ? how can u use it ?? i got AC althoughis there any *ALTERNATIVE SOLUTION * On Thu, Feb 3, 2011 at 8:26 PM, rahul rai raikra...@gmail.com wrote: does this has to do with floating point representation of numbers

Re: [algogeeks] Re: Good Maths Question

2011-01-24 Thread Logic King
hey, but what's the solution to the problem...how to calculate the ratio ?? On Mon, Jan 24, 2011 at 11:19 PM, juver++ avpostni...@gmail.com wrote: @fight :) it's only for my pleasure :) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

[algogeeks] MBINGO

2011-01-24 Thread Logic King
help me solve the problem...how to approach the problem ?? https://www.spoj.pl/problems/MBINGO/ -- 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

Re: [algogeeks] Recursive Function For insertion in BST

2011-01-16 Thread Logic King
i agree with you.the head in the function is different from what it is in the main() as it is not global..so it doesnt get modified thnx :) On Sun, Jan 16, 2011 at 11:21 AM, pacific pacific pacific4...@gmail.comwrote: #include stdio.h #include stdlib.h struct node { int a ; };

[algogeeks] Recursive Function For insertion in BST

2011-01-15 Thread Logic King
hello all, i am a beginner to data structures.I have created a recursive function for insertion of a node in BST,but the function is not working properly.plz correct me,probably i am doing something wrong with the pointers help required :( .urgent !! the function is here--- void

Re: [algogeeks] Recursive Function For insertion in BST

2011-01-15 Thread Logic King
is there any difference between struct node *lchild; and struct node* lchild; ?? On Sat, Jan 15, 2011 at 6:42 PM, manoj lalavat manoj.lala...@gmail.comwrote: http://cslibrary.stanford.edu/110/ On Sat, Jan 15, 2011 at 6:36 PM, Logic King crazy.logic.k...@gmail.comwrote: hello all