Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Efficiency of 'a list
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-05-05 (07:32)
From: Diego Olivier Fernandez Pons <Diego-Olivier.FERNANDEZ-PONS@c...>
Subject: Re: [Caml-list] Two types of efficiency (Was Efficiency of 'a list)

> Languages like PHP have more advanced built-in datastructures with
> language syntax to support them. In Ocaml, we can create the same
> program, however, there is no syntax support, and we have to add
> declarations like
> module StringSet = Set.Make(struct
>       type t = string
>       let compare = compare
>     end) ;;

You should not use a set of strings but a trie. There are of course a
lot of ways to implement tries :

- trees of lists
- trees of arrays (or an optimized version with strings)
- ternary trees (balanced or not)

You may even minimize your acyclic automaton using any of the
following algorithms :
- 2 phases algorithm (cf Dominique Revuz PhD thesis)
- Incremental minimization (Incremental construction of a minimal
acyclic finite state automata, Daciuk, Milhov, B. Watson, R. Watson,
Computer linguistics volume 26 number 1 mars 2000)
- minimization by Brzozowki's algorithm
- minimization by Hopcroft's algorithm

For which one of these versions should Caml provide build-in support ?

        Diego Olivier

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: