- new -> new-sequence
- construct-empty -> new
- construct-boa -> boa
- diff -> assoc-diff
- union -> assoc-union
- intersect -> assoc-intersect
- seq-diff -> diff
- seq-intersect -> intersect
union
operates on sequences.Somehow,
seq-diff
and seq-intersect
were implemented as O(n^2) algorithms. Now, they use hashtables and are O(n).Lastly, a new vocabulary named ``sets'' contains the set theoretic words, along with a new word
unique
that converts a sequence to a hash table whose keys and values are the same. An efficient union and intersect are implemented in terms of this word.
No comments:
Post a Comment