[algogeeks] Re: Free cPanel web hosting worth $100 for your Domain!

2007-11-20 Thread Vishal
http://groups.google.com/group/algogeeks - Click on message - View Profile - Report Profile - Report as Spam Everyone on this group should do this.. On Nov 19, 2007 8:47 PM, Venkatraman S [EMAIL PROTECTED] wrote: cant this user be blocked? On Nov 19, 2007 8:11 PM, Riaz Muhammad [EMAIL

[algogeeks] Re: Summation with log.

2007-10-18 Thread Vishal
The first sum is - lg n + lg (n-2) + lg (n-4) + + lg 4 + lg 2 The second sum is - lg 2 + lg 4 + ... + lg (n-2) + lg n Both are same. To derive second from first, let 2m=(n-2i). Now adjust the limits. On 10/18/07, Allysson Costa [EMAIL PROTECTED] wrote: Dear friends, I'm begginer at

[algogeeks] Re: Programing problem

2007-10-05 Thread Vishal
side. This seems naive, maybe incorrect, I am not too sure about it. Can anyone comment? ~Vishal On 10/5/07, adak [EMAIL PROTECTED] wrote: For each test case Do call function Read_it() /* read the next move */ call Count_it() /* count the # of squares walked through

[algogeeks] Re: Daastaan e Amu Sabzi Forush...

2007-10-01 Thread Vishal
Mark spam - http://groups.google.com/groups/profile?enc_user=D7SZpxEAAAB_G3H9X4k7X3q40369yDelkdEasx1kiYTQavV7mdW13Q Btw, doesn't the man on the right (open the original link) look like Brad Garrette? :) On 10/1/07, Aminooo~ [EMAIL PROTECTED] wrote: Visit:

[algogeeks] Re: Google Interview Question: find shortest summary containing all key words

2007-09-26 Thread Vishal
: To Vishal: My idea is similar to yours. I like to use hash table as well. But I wonder which hash function can you use to insert and find keywords with O(1) time? Keywords are not single characters. They are normal words. That's basically what I am aftering. On Sep 25, 2:11 pm, Mayur [EMAIL

[algogeeks] Re: Google Interview Question: find shortest summary containing all key words

2007-09-24 Thread Vishal
to be a single characters, or you can store them in array, but then you need binary search,:) Vishal 写道: How about keeping two pointers - startp and endp. Keep a count of frequencies of keywords between startp and endp, both inclusive. We can use an array / hash table for this. Now

[algogeeks] Re: Need Algorithm for Persistence number

2007-06-10 Thread Vishal
if ( n = 9 ) return (10+n); ret = 0; while (n9) { found = false; for ( i = 9 to 2 ) if (n%i == 0) { ret = ret * 10 + i; n /= i; found = true; } if ( !found ) { print( Not possible); return; } } Now sort the digits of ret and return. However this will work for small

[algogeeks] Re: same perimeter triangles

2007-06-08 Thread Vishal
Not really. The third equation is trivial and can be derived from other two. So in fact we have two equations and 3 unknowns. On 6/8/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: the distance ap, bp and cp are the unknowns. we can get 3 simultaneous equations based on the condition that

[algogeeks] Re: Pigeon Hole Principle

2007-03-25 Thread Vishal
events. Can somebody explain? ~Vishal On 3/25/07, Prunthaban Kanthakumar [EMAIL PROTECTED] wrote: Ouch I got the question completely wrong assuming the inner disc is continuous.Sorry for the confusion. On 3/25/07, Prunthaban Kanthakumar [EMAIL PROTECTED] wrote: On 3/25/07, Rajiv

[algogeeks] Re: Pigeon Hole Principle

2007-03-25 Thread Vishal
it. But for arbitrary configuration, when one configuration does not work, you cannot align the other half. It will not fit unless the sections are painted symmetrically. On 3/25/07, Vishal [EMAIL PROTECTED] wrote: I did assume that the outer disk is painted half (contiguous) red and half white

[algogeeks] Re: Pigeon Hole Principle

2007-03-24 Thread Vishal
Let R be the total reds on inner disk. Consider a half with 'r' reds. Half1 = r reds and 100-r whites Half2 = R-r reds and 100-R+r whites. If r = R-r, match half1 with Red half of outer disk. Total matching = r + 100 - R + r = 100 - R + 2*r Now r = R - r = 2*r - R = 0 Total matching = 100 - R +

[algogeeks] Re: Pigeon Hole Principle

2007-03-24 Thread Vishal
The problem statement particularly mentions that inner disk has red and white sections painted **arbitrarily**. It doesn't say any such thing about outer disk. On 3/24/07, Rajiv Mathews [EMAIL PROTECTED] wrote: On 3/24/07, Vishal [EMAIL PROTECTED] wrote: If r = R-r, match half1 with Red

[algogeeks] Re: N-Queens problem

2007-02-24 Thread Vishal
It uses backtracking (DFS with tree pruning). So exponential. On 2/24/07, amin [EMAIL PROTECTED] wrote: Hi Dear what is the best order in this problem? N-queens Problem' --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[algogeeks] Re: MIPT Problem

2007-02-12 Thread Vishal
Brute force will work here, since there are only 4 variables. So 3 loops. Loop for x2, x3 and x4 values within limits. Total calculations are 500*333*250, small enough to complete within 5 seconds. Of course the better approach is DP. On 2/12/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

[algogeeks] Re: How to approach this programming problem?

2006-12-23 Thread Vishal
-1]; For other chess pieces, change the dp logic (After j loop). ~Vishal On 12/24/06, BoBo_C [EMAIL PROTECTED] wrote: Hi- I recently ran across a programming problem that I didn't even know how to begin to solve. I'm just now learning algorithms, and I imagine some type of algorithm

[algogeeks] Re: Proving Waring hypothesis...

2006-10-31 Thread Vishal
efficient, use ranges for a, b, c as [0..sqrt(n)], [a .. sqrt(n)], [b..sqrt(n)]. ~Vishal On 10/31/06, Dhyanesh (ધયાનેશ) [EMAIL PROTECTED] wrote: I have a slight improvement O ( n^2 log (n ) )Say you have a^2 + b^2 + c^2 = d.Keep a sorted list of all possible a^2 + b ^ 2 ... this would take n^2 time

[algogeeks] Re: Obtaining each digit from an integer in Java.

2006-09-17 Thread Vishal
N = 5732 (in example)while ( N 0 ){ push( N % 10 ); N = N / 10;}This will give you digits in reverse order. Read it in reverse order or store it in stack.~Vishal On 9/17/06, Bullislander05 [EMAIL PROTECTED] wrote: Hello,I'm fairly new to these parts and I come to ask a question.If anyone here has

[algogeeks] Re: Try this ..

2006-08-15 Thread Vishal
The simple way would be (for random numbers scenario) to sort the array - O(n log n) - and then traverse through the array to find the repeated element - O(n).The creation of link list is nothing but insertion sort, which is O(n^2). ~VishalOn 8/15/06, akshay ranjan [EMAIL PROTECTED] wrote: Not

[algogeeks] Re: hi..plz solve this..

2006-07-06 Thread Vishal
What about O(1) space complextity? I think your solution has space complexity of O(n).~VishalOn 7/6/06, Arunachalam [EMAIL PROTECTED] wrote:Hi, can you please elaborate on your question? If I understand you correct then you are given an array of Length 2n with elements a1,a2...an,b1,b2.. bn.

[algogeeks] Re: Finding the distance between two permutations of a string of length N

2006-05-14 Thread Vishal
one into another.abcd(swap a and c) - cbad(swap d and b) - cdab(swap b and a)- cdba-- Vishal PadwalTel : 631-645-1406 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send

[algogeeks] Re: puzzle from code4bill

2006-01-23 Thread Vishal
You have to consider permutations as well and not just combinations.This will increase the total number of ways.~VishalOn 1/23/06, Ankur Khetrapal [EMAIL PROTECTED] wrote: thisis done using integral solution method.. letx - no. of single steps lety - no of double steps x + 2y = 22 x = 22 - 2y

[algogeeks] Re: 100 programmers

2005-11-18 Thread Vishal
^2)? Well, if you sort the array, then the numbers with lowest difference are bound to get next to each other. So you need to check only consecutive elements for their differences. I don't know the linear time algo though! ~Vishal On 11/18/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: #1: He's

<    1   2