[algogeeks] Re: Enumerating trees

2008-05-15 Thread Bruno Avila
> > Given the conditions for the subgraphs, it's always possible to create > a graph that limits the size of all the acceptable subgraphs to less > than > three nodes. > In the problem, there are no constraints on the cardinality of the subgraphs. It could have a subgraph with all nodes (e.g. if

[algogeeks] Re: Enumerating trees

2008-05-14 Thread Bruno Avila
(reformatting last email) > > these as 1 or 4 or something in between? > > Also does a single node count as a tree? > These are good questions. In my problem, a binary tree is different if the set of nodes are different. For example: a We have 9 different binary trees: {a}, {

[algogeeks] Re: Enumerating trees

2008-05-14 Thread Bruno Avila
> > these as 1 or 4 or something in between? > > Also does a single node count as a tree? > These are good questions. In my problem, a binary tree is different if the set of nodes are different. For example: a We have 9 different binary trees: {a}, {b}, {c}, {a,b}, {b,c}, {b,

[algogeeks] Re: Enumerating trees

2008-05-13 Thread Bruno Avila
Yes, you're right. It depends on the topology of the graph. Do you have any references for the upper or lower bound? Or even an asymptotic of form O(2^k)? Bruno On Tue, May 13, 2008 at 12:28 PM, Geoffrey Summerhayes <[EMAIL PROTECTED]> wrote: > > > > > On May 12, 8:20 pm, brunotavila <[EMAIL PR

[algogeeks] Re: GIVE AN ALGORITHM TO MERGE 2 BINARY SEARCH TREES

2006-08-04 Thread Bruno Avila
Look to the problem as merge of two sorted array, thus, use the same technique the merge sort uses (linear time).Regards,BrunoOn 8/4/06, deadlock <[EMAIL PROTECTED]> wrote:How to basically merge the two BST?? --~--~-~--~~~---~--~~ You received this message because

[algogeeks] Re: Which is the fastest solution for comparing two arrays?

2006-07-19 Thread Bruno Avila
To sort an array A you could use Radix Sort, which complexity is O(d*n), where d = log2(max(A)). So,sort the first array -> O(d*n)sort the second array -> O(e*n)compare the two arrays -> O(n)the solution : (d+e+1)*O(n) = O(n) Use it only if (d+e+1) is smaller than the hash constant.Bruno Avila2006/

[algogeeks] Re: Recursion in blobs

2006-01-26 Thread Bruno Avila
Try looking for Component Labelling Algorithms, which is a two-pass classic algorithm that put an label for each connected group of pixels (component) and, thus, you can also find the total of components (blobs) and their areas.Bruno2006/1/26, H. <[EMAIL PROTECTED]>: Today in a data structures clas