[algogeeks] Re: Division into 2 sets

2009-08-14 Thread Ajinkya Kale
Should the difference be = 0 always ? On Fri, Aug 14, 2009 at 6:57 PM, fundoonick fundoon...@yahoo.co.in wrote: Problem: I have a set of positive integers. I have to divide it into 2 sets such that the difference of the sums of both sets is minimum. For ex, the given set of +ve integers is:

[algogeeks] Re: Division into 2 sets

2009-08-14 Thread Ajinkya Kale
sorry i meant =0 .. or are negative differences allowed ? On Fri, Aug 14, 2009 at 7:02 PM, Ajinkya Kale kaleajin...@gmail.com wrote: Should the difference be = 0 always ? On Fri, Aug 14, 2009 at 6:57 PM, fundoonick fundoon...@yahoo.co.inwrote: Problem: I have a set of positive integers. I

[algogeeks] Re: Missing numbers

2009-07-29 Thread Ajinkya Kale
use hashing. On Wed, Jul 29, 2009 at 4:50 PM, Vijayasarathy K vijaykan@gmail.comwrote: Consider an array of 'n' elements which contains all except 2 numbers from 1(n + 2). How can we find the 2 missing elements? -- Ciao, Ajinkya

[algogeeks] Re: permuting the elements of an array

2009-06-23 Thread Ajinkya Kale
Yeah c++ STL nextpermutation api will do it .. good solution Miroslav! On Tue, Jun 23, 2009 at 10:25 PM, Miroslav Balaz gpsla...@googlemail.comwrote: It is also so easy, but maybe requires more lines of code you only need count number of used number for each 1..n and then...(repeat recursive

[algogeeks] Re:

2009-06-02 Thread Ajinkya Kale
Hey I have the answer but i dont have office 2007 so cant open the xlsx file .. I dont have any MS office version ... can you use something like google spreadsheets ? On Tue, Jun 2, 2009 at 3:00 PM, Aminooo~ amin...@gmail.com wrote: *Dear Friends,* * * *A question for the genius, the one

[algogeeks] Re:

2009-06-02 Thread Ajinkya Kale
Yeah :) On Tue, Jun 2, 2009 at 3:22 PM, Arun arunm...@gmail.com wrote: Spammers have really become smarter and smarter... On Tue, Jun 2, 2009 at 2:44 AM, Vaibhav Jain vaibhav...@gmail.com wrote: Hi dude...i solved it and sending u back with my name. On Tue, Jun 2, 2009 at 3:00 PM,

[algogeeks] Re: Semaphore

2009-05-31 Thread Ajinkya Kale
did you try the wiki : http://en.wikipedia.org/wiki/Semaphore_(programming)? On Sun, May 31, 2009 at 4:57 PM, Miroslav Balaz gpsla...@googlemail.comwrote: Does anybody know how to simulate semaphore by binary semaphore?I think it is easy, but i cant find it on internet. thanks -- Ciao,

[algogeeks] Re: Deciding on a project

2009-05-28 Thread Ajinkya Kale
Yeah .. I am a programmer too and industry coding sucks most of the times.. You should not opt for real world programming at this age .. make your basics strong. If you are really interested in algorithms and want to go ahead and do research in algorithms and their complexity then you should

[algogeeks] Re: Deciding on a project

2009-05-28 Thread Ajinkya Kale
code a || tracks.never ever insult industry programmers.. On Thu, May 28, 2009 at 8:48 PM, Ajinkya Kale kaleajin...@gmail.comwrote: Yeah .. I am a programmer too and industry coding sucks most of the times.. You should not opt for real world programming at this age .. make your basics

[algogeeks] Re: Deciding on a project

2009-05-25 Thread Ajinkya Kale
Try some open source projects .. thats the best place to start. You may want to take a look at Apache's page ... On Mon, May 25, 2009 at 11:58 AM, Albert albert.xtheunkno...@gmail.comwrote: Miroslav Balaz wrote: you should register on www.topcoder.com!!! and according to your skill you

[algogeeks] Re: Deciding on a project

2009-05-24 Thread Ajinkya Kale
And also try your hand at www.projecteuler.net On Sun, May 24, 2009 at 5:57 PM, Miroslav Balaz gpsla...@googlemail.comwrote: you should register on www.topcoder.com !!! and according to your skill you should try to solve some problems from http://www.spoj.pl/ or acm.sgu.ru If you were

[algogeeks] Re: crossword solver using the exact cover problem (algorithm X)

2009-05-19 Thread Ajinkya Kale
Check the references in the wiki page of Algorithm X On Tue, May 19, 2009 at 9:53 PM, std...@gmail.com std...@gmail.com wrote: Hello! I'm trying to implement a crossword solver. My intuition is telling me that the problem can be modeled with the exact cover problem and can thus be solved

[algogeeks] Re: Algorithmic challenge?

2009-05-08 Thread Ajinkya Kale
It is working if you remove the space bet // and ilpubs here you go : http://ilpubs.stanford.edu:8090/750/1/2003-29.pdf On Thu, May 7, 2009 at 8:44 PM, Miroslav Balaz gpsla...@googlemail.comwrote: the link is not working http:// ilpubs.stanford.edu:8090/750/1/2003-29.pdf 2009/5/6 UKuser

[algogeeks] Re: exact solution to this recursion equation

2009-04-02 Thread Ajinkya Kale
merge sort T(n)=2T(n/2)+n=2(2T(n/4)+n/2 )+n=4T(n/4)+2n=4(2T(n/8)+n/4 )+2n=8T(n/8)+3n there will be always only contains linear terms, however ... 2009/4/1 Ajinkya Kale kaleajin...@gmail.com The intuitive proof maybe that if you try to expand the recursion over a few steps

[algogeeks] Re: exact solution to this recursion equation

2009-04-01 Thread Ajinkya Kale
I dont think you even need to solve the recursion .. by looking at it it seems to be O(n^2) right ? On Wed, Apr 1, 2009 at 2:18 PM, Miroslav Balaz gpsla...@googlemail.comwrote: no that is just asymptotic recursion. the answer is between n^2 and n^2log n of coure the answer is n^2;

[algogeeks] Re: exact solution to this recursion equation

2009-04-01 Thread Ajinkya Kale
, for that.i alsow see from first sight that it is O(n^2), but i wane just fo verify that. 2009/4/1 Ajinkya Kale kaleajin...@gmail.com I dont think you even need to solve the recursion .. by looking at it it seems to be O(n^2) right ? On Wed, Apr 1, 2009 at 2:18 PM, Miroslav Balaz gpsla

[algogeeks] Re: Need Help in a new problem

2009-03-14 Thread Ajinkya Kale
/13 Ajinkya Kale kaleajin...@gmail.com If i am not wrong there is a parameterized algorithm for this which is in P On Fri, Mar 13, 2009 at 3:40 AM, Miroslav Balaz gpsla...@googlemail.com wrote: Ok this is NP-comlete... so no fast algorithm is known 2009/3/12 Amina Maarouf

[algogeeks] Re: Find SquareRoot of a number

2009-02-09 Thread Ajinkya Kale
We wont suggest you to use sqrt() function but we will suggest that you do your homework on your own...else atleast post what problem are you facing in implementing the same. Here is a pointer for your problem. You can use any of the approximation methods mentioned here :

[algogeeks] Re: Backtracking algorithm

2008-11-04 Thread Ajinkya Kale
Can you be a bit more specific ? On Tue, Nov 4, 2008 at 9:12 AM, Luciano Pinheiro [EMAIL PROTECTED]wrote: Please, help me people ! I need understand and develop a backtracking algorithm to include into a program and I don't nkow where find these. Someone have any document, or URL to

[algogeeks] Re: recurrence relation

2008-09-15 Thread Ajinkya Kale
, and the second case shall hold. Where did you get this question from, if I may ask? On Sep 14, 10:00 pm, Ajinkya Kale [EMAIL PROTECTED] wrote: Actually there is one more condition to it but i thought it will be more complicated to mention it, at each step we subtract 2^(ceil(log n) if n

[algogeeks] Re: recurrence relation

2008-09-14 Thread Ajinkya Kale
Sorry i forgot, it is ceil(log n) so n-2^( ceil(log n) ) is not equal to zero.. On Sun, Sep 14, 2008 at 8:57 AM, Karthik Singaram Lakshmanan [EMAIL PROTECTED] wrote: Isn't n-2^logn = 0? since 2^logn = n if you are talking about log base 2 -- Ciao, Ajinkya

[algogeeks] Re: finding whether the number is prime or not ...

2008-06-28 Thread Ajinkya Kale
There are a few really good randomized algorithms on primality testing. The AKS algorithm is i guess the best know deterministic primality testing algo. On Sat, Jun 28, 2008 at 1:22 PM, Sumedh Sakdeo [EMAIL PROTECTED] wrote: u can refer this site... its very cool...

[algogeeks] Re: algo for finding the union of two sets ...

2008-06-23 Thread Ajinkya Kale
Yup there are . Refer horowitz sahani book on algorithms called fundamentals of algorithms On Mon, Jun 23, 2008 at 4:36 PM, zee [EMAIL PROTECTED] wrote: do we have an algo for finding the union of two sets ??? data structure suitable for set operations -- Ciao, Ajinkya

[algogeeks] recurrence equation

2008-06-04 Thread Ajinkya Kale
How do we solve recurrence relations of the form: T(c) = T( | c - 2^ceil(log_2(c)) | ) + O( 2^ceil(log_2c) ) What will be the approximate outcome of this equation if not exact ? -- Ciao, Ajinkya --~--~-~--~~~---~--~~ You received this message because you are

[algogeeks] Re: recurrence equation

2008-06-04 Thread Ajinkya Kale
)) | will be 0 if log is base 2. Obviously I am missing something, could you throw some light on that expression? On Wed, Jun 4, 2008 at 10:26 AM, Ajinkya Kale [EMAIL PROTECTED] wrote: How do we solve recurrence relations of the form: T(c) = T( | c - 2^ceil(log_2(c)) | ) + O( 2^ceil(log_2c) ) What

[algogeeks] Re: Empty Binary tree???

2008-06-03 Thread Ajinkya Kale
On Tue, Jun 3, 2008 at 1:35 PM, Dave [EMAIL PROTECTED] wrote: The definition is recursive. The empty binary tree is the base case for the recursion. If a binary tree couldn't be empty, then all binary trees would have to be infinite. One way to think of this is that the left and right

[algogeeks] Re: Empty Binary tree???

2008-06-03 Thread Ajinkya Kale
because someone in one subtree of that person married someone in anther subtree many generations later. Dave On Jun 3, 10:48 am, Ajinkya Kale [EMAIL PROTECTED] wrote: On Tue, Jun 3, 2008 at 1:35 PM, Dave [EMAIL PROTECTED] wrote: The definition is recursive. The empty binary tree

[algogeeks] Re: Empty Binary tree???

2008-06-03 Thread Ajinkya Kale
. This happened because someone in one subtree of that person married someone in anther subtree many generations later. Dave On Jun 3, 10:48 am, Ajinkya Kale [EMAIL PROTECTED] wrote: On Tue, Jun 3, 2008 at 1:35 PM, Dave [EMAIL PROTECTED] wrote: The definition is recursive

[algogeeks] Re: A pair-selecting problem

2008-05-28 Thread Ajinkya Kale
On Wed, May 28, 2008 at 1:53 PM, Zeratul [EMAIL PROTECTED] wrote: On a board there are N * 2 pins colored with either black or white. The number of black pins is equal to that of white ones. Each pin has a location x, y, and x y are all integers (there are no more than one pins on the same

[algogeeks] Re: Enumerating trees

2008-05-14 Thread Ajinkya Kale
. On 5/14/08, pramod [EMAIL PROTECTED] wrote: Let's say we have E number of edges and V number of vertices. Any subgraph which is a tree with V vertices will have V-1 edges. So we need to retain V-1 edges and eliminate the rest E-(V-1). So in a brute force manner if we retain any set of

[algogeeks] Re: Red Black trees

2008-05-03 Thread Ajinkya Kale
Grab a copy of introduction to algorithm - Cormen,Rivest,Leiserson,Stein. It deals with Red Black trees in detail. On Sat, May 3, 2008 at 1:13 PM, Arunachalam [EMAIL PROTECTED] wrote: Search in the net. Red Black trees are explained here http://en.wikipedia.org/wiki/Red_black_tree If you

[algogeeks] Re: An interesting graph problem

2008-02-24 Thread Ajinkya Kale
On 2/24/08, Sticker [EMAIL PROTECTED] wrote: I have a graph problem, which is different from the standard salesman problem. I say it is more difficult. In a graph, I have many vertexes with different colors. It is more easier to think of each vertex as a shop selling only one goods and

[algogeeks] Re: permuttaion

2008-02-21 Thread Ajinkya Kale
I think this is a homework question. Any algorithm book will give you an algorithm for permutation.Try google first. On Thu, Feb 21, 2008 at 3:44 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: hi, can some one help me in writing an algorithm for finding permuttaion of 'n' numbers??..i

[algogeeks] Re: Frog Problem

2008-02-11 Thread Ajinkya Kale
Here is the link which discusses the porblem but instead of stones the problem talks of steps. But the problem is exactly the same. http://groups.google.com/group/programming-challenges/browse_thread/thread/cd2b733400989439/bb50217ab89c3f42?lnk=gstq=Steps#bb50217ab89c3f42 Check out the discussion

[algogeeks] Re: a non-recursive algorithm that prints all the nodes of a binary tree in O(n)

2008-02-11 Thread Ajinkya Kale
I personally dont think so. 2008/2/11 Pradeep Muthukrishnan [EMAIL PROTECTED]: Is it even possible to do taht in constant space? 2008/2/11 [EMAIL PROTECTED] [EMAIL PROTECTED]: Thanks for all the effort. Sorry, I should have mentioned it earlier. But, we are asked to do it without

[algogeeks] Re: road traffic

2008-01-25 Thread Ajinkya Kale
Hey I am interested too...pls do let me know what do we have to do.. On 1/24/08, Albert Sanchez [EMAIL PROTECTED] wrote: Hi, Anyone interested in road traffic strategies? Flow optimization, time dependent shortest paths problems? Albert -- Ciao, Ajinkya

[algogeeks] Re: 8 puzzle problem

2008-01-09 Thread Ajinkya Kale
Check out any AI bookA good dynamic algo is illustrated in Horwitz Sahani book Fundamentals of Algorithms On Jan 10, 2008 10:03 AM, monu [EMAIL PROTECTED] wrote: Hi guys! i am working on 8puzzle problem, but i am not getting any Heuristic function to solve the problem. Can anyone

[algogeeks] Re: How is the Big O actually calculated, time wise?

2007-11-22 Thread Ajinkya Kale
Big Oh notation only gives the proportionality of the time required for that particular algorithm. For an approximation you can assume some hypothetical machine and calculate the time taken using the costs for loads,stores,etc. And you can also find the total time for execution using the platform

[algogeeks] Re: array of 0s and 1s

2007-11-13 Thread Ajinkya Kale
A simple modification to quicksort will do the trick ! On 11/13/07, geekko [EMAIL PROTECTED] wrote: you are given an array of integers containing only 0s and 1s. You have to place all the 0s in even positions and 1s in odd position. And if suppose, no. of 0s exceeds no. of 1s or vice versa

[algogeeks] Re: Algo.. phone book

2007-11-09 Thread Ajinkya Kale
How about using a Red-Black tree ? On 11/9/07, Andrey [EMAIL PROTECTED] wrote: I thought about trie first but then I've change my mind and decided that I'd rater use a simple binary tree or even an sorted array. As we have quite limited set of first names and surnames we can easily index

[algogeeks] Re: Finding the n integers given the set of sums.

2007-11-07 Thread Ajinkya Kale
check out : http://groups.google.co.in/group/programming-challenges/browse_thread/thread/f9e5436fbc6dbc56?hl=en # On 11/7/07, anvera [EMAIL PROTECTED] wrote: I have not developed entirely the idea, but I am sure it works. Just write the corresponding linear system. You will have n unknowns

[algogeeks] Re: Finding the n integers given the set of sums.

2007-11-07 Thread Ajinkya Kale
On 11/7/07, anvera [EMAIL PROTECTED] wrote: Why not? Does order really matters here? Look at the symmetry of the problem. Put 3,4,5,5 and then 4,5,6,7 at the right side. Look at the solutions. How they differ? Is this natural? Though the order is not imp you cant tell which 2 variables for

[algogeeks] Re: Summation formules

2007-10-22 Thread Ajinkya Kale
On 10/22/07, Allysson Costa [EMAIL PROTECTED] wrote: I have some doubts about summation notation 1) Is there a formule like: SUM (LOG i) i=1 to i=n is equivalent to LOG (N)! This formule is true? Yes it is true .

[algogeeks] Re: Spiral number

2007-10-21 Thread Ajinkya Kale
Check out these 2 links which discuss the same problem. Some codes are also posted. http://groups.google.com/group/programming-challenges/browse_thread/thread/88bcbea02029c2bf http://groups.google.com/group/programming-challenges/browse_thread/thread/9acf71cb87e9ffd3 This is a good group

[algogeeks] Re: Doubt with summation

2007-10-20 Thread Ajinkya Kale
let n - 2i = 2mie 2i = n-2m hence SUM { lg (n-2i) } = SUM { lg (2m) } no the limits upper limit = i = n/2-1 ie 2i = n-2 ie n-2m = n-2 ie m=1 lower limit = i = 0ie 2i = 0 ie n-2m = 0ie m=n/2 therefore the summation is SUM { lg((2m) }

[algogeeks] Re: Doubt with summation

2007-10-19 Thread Ajinkya Kale
substitute n-2i = 2m in firsst equationyou will get the left one on reducing the terms in terms of m. On 10/19/07, Allysson Costa [EMAIL PROTECTED] wrote: Anyone can give a explanation how I get the equation below true? Why lg(n-2i) became lg(2i)? Thanks in advance. Allysson

[algogeeks] Re: Programing problem

2007-10-07 Thread Ajinkya Kale
On 10/7/07, macharla pradeep [EMAIL PROTECTED] wrote: Hi, if ( commnad sequence is bad ) whether to include it area calculation or not?? It is mentioned that command sequence is never bad. On 10/5/07, piruk [EMAIL PROTECTED] wrote: Hi. How to solve this task?