Re: efficient comparison
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Tue, 28 Aug 2007 20:31:59 -0400
Ben Bacarisse wrote:
CBFalconer <cbfalconer@xxxxxxxxx> writes:
Ben Bacarisse wrote:
CBFalconer <cbfalconer@xxxxxxxxx> writes:
bob@xxxxxxxxxxxxxx wrote:
Let's say you have a set of names called set A. You also have a
different set of names called set B. What is the most efficient
way of comparing the sets?
By comparison, I mean finding the names that need to be added to
set B and deleted from set B to form set A.
Use Pascal, and then those are all primitive operations. I kid you
not.
Lots of languages have sets but Pascal's sets used to be so limited as
to be almost useless of general versions of the above problem. Does
modern Pascal have sets of anything more flexible that enumerated
types?
I think you are worrying about the restriction to things that can
be enumerated.
Indeed I am.
Systems vary as to the sizes of that enumeration
handleable. But once you have it, things are easy. Chars. are
automatically enumerated, so:
TYPE
ucase = 'A' .. 'Z';
lcase = 'a' .. 'z';
VAR
upper = SET OF ucase;
lower = SET OF lcase;
alpha = SET OF char;
Well, that much I knew (I used to teach Pascal). The question is
what is the least that one can reply on when using Pascal? Has
Pascal moved on so that the SET OF idea is more useful? You seem
to be knowledgeable about modern Pascal standards (the last one I
used was the first ISO standard Pascal) so I thought I'd ask.
In particular, for the OP's question, can one have sets of
arbitrary strings?
You didn't read far enough in my original answer.
Also, the Pascal standard hasn't changed, and the standard for
Extended Pascal is purely an extension of ISO7185. But I haven't
used either seriously for some years.
--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
--
Posted via a free Usenet account from http://www.teranews.com
.
- Follow-Ups:
- Re: efficient comparison
- From: Ben Bacarisse
- Re: efficient comparison
- References:
- efficient comparison
- From: bob
- Re: efficient comparison
- From: CBFalconer
- Re: efficient comparison
- From: Ben Bacarisse
- Re: efficient comparison
- From: CBFalconer
- Re: efficient comparison
- From: Ben Bacarisse
- efficient comparison
- Prev by Date: Re: efficient comparison
- Next by Date: Re: (Source Code Download) Re: Fast pi program?
- Previous by thread: Re: efficient comparison
- Next by thread: Re: efficient comparison
- Index(es):