Re: [algogeeks] Re: increment operator...

2012-11-15 Thread Aamir Khan
. 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. -- Aamir Khan | 4th Year | Computer Science Engineering

[algogeeks] increment operator...

2012-11-07 Thread Aamir Khan
@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. -- Aamir Khan | 4th Year | Computer Science Engineering | IIT Roorkee -- You received this message because you

[algogeeks] Re: Printing all inversions in an array

2012-10-23 Thread Aamir Khan
', 'algogeeks%2bunsubscr...@googlegroups.com');. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Aamir Khan | 4th Year | Computer Science Engineering | IIT Roorkee -- You received this message because you are subscribed to the Google Groups Algorithm

[algogeeks] Printing all inversions in an array

2012-10-21 Thread Aamir Khan
an inversion if A[i] A[j] and i j [1] http://www.geeksforgeeks.org/archives/3968 -- Aamir Khan | 4th Year | Computer Science Engineering | IIT Roorkee -- 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: [algogeeks] A theoritical question

2011-12-05 Thread Aamir Khan
to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Aamir Khan | 3rd Year | Computer Science Engineering | IIT Roorkee -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group

Re: [algogeeks] A theoritical question

2011-12-05 Thread Aamir Khan
are uncountably infinite. On Mon, Dec 5, 2011 at 4:26 PM, Aamir Khan ak4u2...@gmail.com wrote: On Mon, Dec 5, 2011 at 3:31 PM, saurabh singh saurab...@gmail.comwrote: I was wondering can we design a machine(Even hypothetical) that can find a *perfect square root *of any integer thats given

Re: [algogeeks] NUMBER OF MST ?

2011-12-03 Thread Aamir Khan
it. On 03-Dec-2011 11:30 PM, Dipit Grover dipitgro...@gmail.com wrote: ^ we need to count each permutation and its reverse together as one possibility since both would result in identical mst. Aamir Khan | 3rd Year | Computer Science Engineering | IIT Roorkee -- You received

Re: [algogeeks] facebook interview question

2011-11-28 Thread Aamir Khan
to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Aamir Khan | 3rd Year | Computer Science Engineering | IIT Roorkee -- You received this message because you are subscribed to the Google Groups Algorithm

Re: [algogeeks] Re: finding closest points

2011-11-22 Thread Aamir Khan
points for a given point, in time better than nlgn. -- Aamir Khan | 3rd Year | Computer Science Engineering | IIT Roorkee -- 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] An Array Problem

2011-11-22 Thread Aamir Khan
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. -- Aamir Khan | 3rd Year

[algogeeks] Long nCr Calculations

2011-11-03 Thread Aamir Khan
answer.. How to deal with this situation ? -- Aamir Khan | 3rd Year | Computer Science Engineering | IIT Roorkee -- 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

Re: [algogeeks] What Data Structure to use ?

2011-10-30 Thread Aamir Khan
On Sun, Oct 30, 2011 at 1:17 AM, Aamir Khan ak4u2...@gmail.com wrote: In a university, students can enroll in different courses. A student may enroll for more than one course. Both students and courses can be identified by IDs given to them. Design a data structure to store students

[algogeeks] What Data Structure to use ?

2011-10-29 Thread Aamir Khan
student. d) Return all students in a list for a given course. Aamir Khan | 3rd Year | Computer Science Engineering | IIT Roorkee -- 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] [SPOJ] ZSUM

2011-10-25 Thread Aamir Khan
As far as modular arithmetic is concerned, (x * z *z )%MOD = (x *(z *z)%MOD)%MOD = ((x%MOD)*(z%MOD)*(z%MOD))%MOD But when you try to calculate *(x * z * z)%MOD*, the intermediate result of* (x * z * z) *overflows the integer limit and hence gives the wrong result. similarly, intermediate value

Re: [algogeeks] Re: Modular arithmetic

2011-10-22 Thread Aamir Khan
://groups.google.com/group/algogeeks?hl=en. -- Aamir Khan | 3rd Year | Computer Science Engineering | IIT Roorkee -- 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] Modular arithmetic

2011-10-21 Thread Aamir Khan
Lets say n,m and p are three long long integers. i want to calculate (n*m)%p. If (n*m) overflows the limit of long long then the answer would be wrong. Moreover if i do ((n%p)*(m%p))%p then also there is no certainty of getting correct answer. How should i do this in C++ ? -- Aamir Khan | 3rd

Re: [algogeeks] i cannot solve this written test question

2011-10-09 Thread Aamir Khan
. -- Aamir Khan | 3rd Year | Computer Science Engineering | IIT Roorkee -- 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

[algogeeks] Segment Tree Optimization

2011-09-27 Thread Aamir Khan
0; } Aamir Khan | 3rd Year | Computer Science Engineering | IIT Roorkee -- 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

Re: [algogeeks] Segment Tree Optimization

2011-09-27 Thread Aamir Khan
. -- Aamir Khan | 3rd Year | Computer Science Engineering | IIT Roorkee -- 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: [algogeeks] Re: Amazon online test

2011-09-24 Thread Aamir Khan
@shiv : Correct Answer should be : 5C3 X 5 X 4 X3 = 600 Aamir Khan | 3rd Year | Computer Science Engineering | IIT Roorkee -- 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: [algogeeks] Re: Run for a google years

2011-05-13 Thread Aamir Khan
this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Aamir Khan Indian Institute of Technology Roorkee, Roorkee, Uttarakhand, India , 247667 Phone: +91 9557647357 email: aami...@iitr.ernet.in

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

2011-05-11 Thread Aamir Khan
, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Aamir Khan Indian Institute of Technology Roorkee, Roorkee, Uttarakhand, India , 247667 Phone: +91 9557647357 email: aami...@iitr.ernet.in aamir...@iitr.ernet.in ak4u2...@gmail.com -- You received this message

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

2011-05-10 Thread Aamir Khan
/algogeeks?hl=en. -- Aamir Khan Indian Institute of Technology Roorkee, Roorkee, Uttarakhand, India , 247667 Phone: +91 9557647357 email: aami...@iitr.ernet.in aamir...@iitr.ernet.in ak4u2...@gmail.com -- You received this message because you are subscribed to the Google Groups

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

2011-05-10 Thread Aamir Khan
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. -- Aamir Khan Indian Institute of Technology Roorkee, Roorkee, Uttarakhand, India , 247667 Phone: +91 9557647357 email: aami

[algogeeks] Square of Large integer

2011-04-14 Thread AAMIR KHAN
#includecstdio #define MOD (int)1e9 using namespace std; int main() { int A = 33554432; printf(%d\n,A*A); printf(%d\n,((A*A)%MOD)); return 0; } How can i calculate, lets say last 9 digits of square of 33554432 ? Thanks, Aamir -- You received this message because you are

[algogeeks] Re: Square of Large integer

2011-04-14 Thread AAMIR KHAN
*Output:* 0 0 On Thu, Apr 14, 2011 at 7:01 PM, AAMIR KHAN ak4u2...@gmail.com wrote: #includecstdio #define MOD (int)1e9 using namespace std; int main() { int A = 33554432; printf(%d\n,A*A); printf(%d\n,((A*A)%MOD)); return 0; } How can i calculate, lets say last 9 digits

Re: [algogeeks] Re: Square of Large integer

2011-04-14 Thread AAMIR KHAN
On Thu, Apr 14, 2011 at 7:40 PM, Akash Mukherjee akash...@gmail.com wrote: search nd read chinese remainder theorem please elaborate how can i use chinese remainder theorem. On Thu, Apr 14, 2011 at 7:04 PM, AAMIR KHAN ak4u2...@gmail.com wrote: *Output:* 0 0 On Thu, Apr 14, 2011 at 7

Re: [algogeeks] Re: Square of Large integer

2011-04-14 Thread AAMIR KHAN
there is no need for long long i think. Dave On Apr 14, 8:31 am, AAMIR KHAN ak4u2...@gmail.com wrote: #includecstdio #define MOD (int)1e9 using namespace std; int main() { int A = 33554432; printf(%d\n,A*A); printf(%d\n,((A*A)%MOD)); return 0; } How can i calculate

Re: [algogeeks] An Interesting Question Calculate nth Power of Integer

2011-03-24 Thread AAMIR KHAN
Try this... #include iostream #include cmath using namespace std; #define DIGITS 10001 void mult(int N,int pro[],int len) { int carry = 0; for(int i=0;ilen;i++) { int temp = pro[i]*N + carry; pro[i] = temp%10; carry = temp/10; } if(carry0) { pro[len] =

Re: [algogeeks] An Interesting Question Calculate nth Power of Integer

2011-03-24 Thread AAMIR KHAN
are going to calculate 8 power 33 u compute 8 power 16 and multiply with the same to get 8 power 32 then multiply with 8 to get the result On Thu, Mar 24, 2011 at 1:04 PM, AAMIR KHAN ak4u2...@gmail.com wrote: Try this... #include iostream #include cmath using namespace std; #define DIGITS

Re: [algogeeks] suggestion required

2011-03-24 Thread AAMIR KHAN
You could try http://domjudge.sourceforge.net/ and do customizations in its source code only.. On Thu, Mar 24, 2011 at 1:22 PM, .bashrc saurab...@gmail.com wrote: Hi I have been working on a progrmming judge that can be deployed in my college.I have already developed a prototype in bash.I