@ Modeling Expert,,thanx
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options,
use array/vector of int to store value. E.g.
if you want to store value : 23451023456678, you can't in a normal int
or long
but You can have int array /vector , say "int A[SIZE] " or "
vector A(SIZE,0)
A[0] 78
A[1] 66
A[2] 45
..
..
I have coded this long back to calculate factorial of big n
very similar to TSP. A standard textbook problem :-)On 4/3/06, sarinarpit <[EMAIL PROTECTED]> wrote:
a directed Hamiltonian cycle DHC in a directed graph G+(V,E) is adirected cycle of length n=|V|,where |V| is the number of vertices in
G.So, the cycle goes through every vertex exactly once and the
There are two more solutions.Let the common computer be called Master and others be called slaves.1. The master maintains a min-priority queue and asks for the smallest number from each slave. It then deques one number from the queue and asks for the next smallest number from the slave which origi
In my algo, this O(N) space restriction is not violated. Each computer
uses O(N) space only. But overall, all the N computers use O(N^2) space.
one of the restriction is that a computer can only hold O(N) integers.
No, each computer after getting the median of medians, partitions the
numbers it has and sends two values to the dedicated computer. Those
two values of number of elements which are less than the median of
medians and number of elements that are greater than the median of
medians. Now the dedicat
Hi,
So do u mean to say that we can leave out those numbers which are less
than the median of medians and greater than the median of medians in
each round? If yes, I have a case to prove this algo wrong.
-VijayOn 12/1/05, pramod <[EMAIL PROTECTED]> wrote:
Let M1,M2, ..., MN be the medians and let
what means O(n) time ? I don't get...
Vijay Venkat Raghavan N wrote:
Hi pramod,
I dont get the last part of your solution. How does it leave us with
n^2/4 lesser and greater than the median? Also if we leave out
everythng thats lesser or greater than a number, all what should be
left is th
Let M1,M2, ..., MN be the medians and let MM be the median of medians.
So (N-1)/2 medians are less than MM and (N-1)/2 medians are greater
than MM.
Since each of these medians has (N-1)/2 elements less and greater than
themselves within each computer, there are (N-1)/2*(N-1)/2 (this is I
mention
Hi pramod,
I dont get the last part of your solution. How does it leave us with
n^2/4 lesser and greater than the median? Also if we leave out
everythng thats lesser or greater than a number, all what should be
left is the number itelf. I am missing something and plz explain your
algo's last part
Each computer finds the median of the numbers it holds. This can be
done in O(n) time and O(n) space by each computer. Now all computers
send their median to a dedicated computer which finds the median of
these medians ( O(n) time and space) and sends this value to all the
computers. Each compute
12 matches
Mail list logo