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
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
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
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:
:
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
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
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
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
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
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
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 +
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
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
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:
-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
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
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
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
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.
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
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
^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
101 - 122 of 122 matches
Mail list logo