Re: [algogeeks] Linked List question

2013-01-07 Thread Doom
Thank you for the code snippet. What I don't understand is if( (double)rand() / RAND_MAX 1 / k ) Here, Why do we use less than inequality? Why won't Udit's solution of just using the minimum random number work? On Tuesday, 1 January 2013 20:57:47 UTC+5:30, Dave wrote: @Doom: Yes

Re: [algogeeks] Linked List question

2013-01-01 Thread Doom
Hi Dave Please help me with some additional clarification regarding the implementation of this algo. How do we make use of random number generator? And is it necessary to traverse the list until the end? On Friday, 28 December 2012 19:35:07 UTC+5:30, Dave wrote: @Sanjeev: Set a pointer p

Re: [algogeeks] expectation values..

2012-06-17 Thread Doom
If we expand it.. E(t) = E(t1) + E(t2) + E(t3) + ... + E(tn); here I am able to derive E(t1) as N/1 using the expression E(t1) = 1/N + ((N-1)/N)(E(t1) + 1); but how do I proceed? How do I derive the E(t2) and so on?? What do these values mean?? Does it mean like E(t2) is the no. of expected

[algogeeks] Re: Find border of a binary tree.

2012-04-08 Thread Doom
wrong. On Fri, Apr 6, 2012 at 10:53 PM, Doom duman...@gmail.com wrote: Here is the reference: http://stackoverflow.com/questions/3753928/finding-border-of-a-binary... None of the proposed solutions is effective enough. Any ideas? -- You received

[algogeeks] Find border of a binary tree.

2012-04-06 Thread Doom
Here is the reference: http://stackoverflow.com/questions/3753928/finding-border-of-a-binary-tree None of the proposed solutions is effective enough. Any ideas? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the

[algogeeks] Path along the diameter of the binary tree

2012-04-06 Thread Doom
We have seen the question of computing the diameter of binary tree. Any ideas to compute the path of nodes along that diameter? No parent pointer exists. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web

[algogeeks] how to code a deterministic or Non-Deterministic finite state automata model?

2012-04-06 Thread Doom
Any pointers to a code using NFA / DFA computation model? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/UO5Em7j89scJ. To post to this group, send email to

[algogeeks] Pruning number of a binary tree

2012-04-06 Thread Doom
Can any one help me in understanding the concept? Here is the reference link: http://stackoverflow.com/questions/8288820/pruning-number-of-a-binary-tree -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web

Re: 答复: [algogeeks] Given an array A[1..n] of log n

2012-04-05 Thread Doom
each number with its count times. I'm not sure whether it is appropriate to call it in-place, but at least it doesn't use O(n) space. Sent from my Windows Phone =E5=8F=91=E4=BB=B6=E4=BA=BA: Doom =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2012/4/4 20:05 =E6=94=B6=E4=BB=B6=E4=BA=BA: algogeeks

[algogeeks] Re: Find the maximum boxes which can fit each other?

2012-04-05 Thread Doom
@Don: Any ideas which oppose the above proposed solution? On Saturday, 24 March 2012 21:52:49 UTC+5:30, Don wrote: Build a graph in which each box is a vertex and there is an edge from A to B if B can fit inside A. Then use the longest path algorithm to find the solution. Don On Mar

[algogeeks] Re: water-jug problem

2012-04-05 Thread Doom
@Don: Could you please explain ur tree approach with an example? Thanks Doom On Tuesday, 3 April 2012 02:52:17 UTC+5:30, Don wrote: I did that by building a tree in which each node stores the configuration, including number of steps to that point, amount of water in each bucket

Re: [algogeeks] Given an array A[1..n] of log n bit integers, sort them in-place in O(n) time

2012-04-04 Thread Doom
how are you going to do it in-place? On Wednesday, 4 April 2012 13:24:01 UTC+5:30, Siddhartha wrote: if the length of the binary representation of elements is logn, then the elements themselves are of size less than 2^log(n)=n. as all the elements are less than n, use counting sort!!! --

[algogeeks] Re: Find the maximum boxes which can fit each other?

2012-04-03 Thread Doom
What is wrong with atul's solution of longest decreasing subsequece on length after sorting on area? I think the relationship is transitive as well. e.g. box a fits inside b. box b fits inside c by transitivity, box a fits inside c. Isn't this fine? On Saturday, 24 March 2012 22:25:33

[algogeeks] Given an array A[1..n] of log n bit integers, sort them in-place in O(n) time

2012-04-03 Thread Doom
Any ideas? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/aGzMcjTFcAYJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from