Re: general algorithm advice
- From: Jon Harrop <jon@xxxxxxxxxxxxxxxxx>
- Date: Tue, 18 Sep 2007 23:13:03 +0100
aldousd666 wrote:
I don't care what language we're talking about, but I do mostly C-like
languages, so perhaps an imperative or Object oriented approach would
be helpful, but I'll take any kind of pseudocode.
The data I"m dealing with are arrays of 4 integer ordinal vectors,
like this:
A = { <a,b,c,d>, <d,e,f,g>, <a,b,c,d>... }
B = { <a,b,c,d>, <d,e,f,g>, <q,r,s,t>... }
I want to be able to find the union, difference, or intersection
(which all center I guess on testing for membership)...
Actually you can do it more efficiently by roughly bisecting sets
recursively (represented as balanced binary trees) rather than using
membership. Both OCaml and F# do this in their stdlib implementations and,
consequently, they are vastly faster than most other languages for this.
--
Dr Jon D Harrop, Flying Frog Consultancy
OCaml for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists/?usenet
.
- Follow-Ups:
- Re: general algorithm advice
- From: aldousd666
- Re: general algorithm advice
- From: aldousd666
- Re: general algorithm advice
- References:
- general algorithm advice
- From: aldousd666
- general algorithm advice
- Prev by Date: Re: an old worn interview question
- Next by Date: Re: Choosing a language
- Previous by thread: Re: general algorithm advice
- Next by thread: Re: general algorithm advice
- Index(es):
Relevant Pages
|