read modeling and simulation book
it has a great discussion on random number generartion and testing
On Mon, Dec 27, 2010 at 11:52 AM, 王大东 dadongk...@gmail.com wrote:
Linear congruential sequence maybe a simple approach.
A[n]=(a*A[n-1]+b)%c,
But it's another problem how to chose a,b,c.
On
your first approach is totally correct.
On Dec 22, 12:36 pm, juver++ avpostni...@gmail.com wrote:
Use bits manipulation tricks.
1. There is a way to remove a group of consecutive 1's from the right: A = n
(n + 1). Then check if A==0 then OK.
2. Second approach: B=n+1, check if B (B-1) (this
Program is incorrect. Why does it output the following answer: point at (3,5
)size is 8???
--
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
interested ppl can read ths link for stream algorithms...
http://www.americanscientist.org/issues/pub/the-britney-spears-problem/1
Mohit
On Sun, Dec 26, 2010 at 7:49 PM, Ankur Khurana ankur.kkhur...@gmail.comwrote:
may be we can assume that klog(n)
else i dont see a way out than hashing ,
when you are talking abt starting from 1 that means that array is 1
based , right ?
Right.
111
000
000
Up-left element: 1
Choice 3: 0 (number of 0's on the first row) + 1 (number of 1's on the
first column) = 1
Choice 4: 3 (number of 1's on the first row) + 2 (number of 0's on the
first
hey...
what's about the storage managment ?
the search text may not be a fixed length string..
is implementation of a node is fessible?
one alternative solution may be associate a hash table along with this. but
again the problem with collision ,, to avoid collision u can use perfect
hashing with
Hello , Sorry :( Chi i can not help you , i don't know that
algorithm .
All the best .
On 26 déc, 20:10, Chi i...@chihoang.de wrote:
Hi,
I'm looking for the fleury or the hierholzer algorithm in php, c or fleury.
Do u can help?
Perhaps u can take a look at bin-packing algorithm and
Thank u for reading. My kart-trie is between a radix-trie and suffix-trie
because a radix-trie can also have as many leafs as suitable and a suffix-trie
also. A kart-trie has exactly 2 leafs per node.
Correct me if I'm wrong!
- Ursprüngliche Mitteilung -
hey...
what's about the
This can be done in O(n ) with O(1) space compexity . This problem can be
reduced to finding the kth smallest number in an unordered collection .
There exists an O(n) algo for this . For finding the 10th most frequent
number we should find (n-10)th smallest number . Once found by doing an
linear
http://tech-queries.blogspot.com/2010/12/find-pythagorean-triples-in-unsorted.html
Regards,
Akash Agrawal
http://tech-queries.blogspot.com/
On Mon, Dec 20, 2010 at 8:12 PM, Dave dave_and_da...@juno.com wrote:
Unless sorting the array is forbidden, sort it and then use the
obvious O(n^2)
@Terence.
Could please elaborate your answer. Bottom up level order traversal helps to
get the final root value but how to use it to find minimum flips needed to
Obtain the desired root value.
On Fri, Dec 24, 2010 at 1:56 AM, Terence technic@gmail.com wrote:
Using the same level order
I have a two arrays
One is
2 5 1 6 4 3
other is
1 2 3 4 5 6.
I want to make an array X which gives the index of its element on other
arrays.
Meaning X[1] = 3 1 is element of the second array and 3 is the index of
element 1 in first array.
How shall we get array X in O(nlogn).
--
You
here is my approach :
Starting from the root node ,
if root node need to have a 1 ...
if root is an and gate :
flips = minflips for left child to have value 1 + minflips for the
right child to have value 1
else
flips = minimum of ( minflips for left child to have value 1 , minflips
for
This problem can be solved using dp in O(n), where 'n' is the number
of nodes in the tree.
Definitions:
Let gate[i] be a boolean denoting whether the gate at node 'i' is
'AND' or 'OR'. (0-'AND' 1-'OR')
Let dp[i][j] store the minimum no. of swaps required to get a value of
'j' (0 or 1), for the
Your approach is for a binary tree, but the problem statement does not
say anything about it.
On Dec 28, 10:27 am, pacific pacific pacific4...@gmail.com wrote:
here is my approach :
Starting from the root node ,
if root node need to have a 1 ...
if root is an and gate :
flips =
It would be interesting to do some tests. Asymptotic performance isn't
always important. It's possible that since we are looking for only the top
10 elements, we'll get better run times using a simple linear scan to find
the insertion point (as in insertion sort) rather than the more complex
16 matches
Mail list logo