Re: This I simply can't swallow

From: Alwyn (alwyn_at_blueyonder.co.uk)
Date: 02/17/05

  • Next message: Artie Gold: "Re: segememtation fault with fclose"
    Date: Thu, 17 Feb 2005 22:05:03 +0000
    
    

    On Thu, 17 Feb 2005 16:00:19 -0500, Gary Labowitz wrote:
    >
    > Yes, I like this.
    > I can define a type (Dog) that has properties (name, age) and model this in
    > various instances. This is enough to deal with the dog-ness of a pet. I can
    > extend this by classes for specific breeds of dogs, but I would still say
    > the Dog class is an ADT because the user of such a class can use it with its
    > public interface without knowing exactly how the information about the name
    > and age are encoded (strings, c-strings, etc.).
    > Does this fit with your thinking?

    If you're looking for an example ADT to give your students, my advice is
    to pick a stack. That's what nine out of ten people do, cos it's nice and
    simple, with only four or five operations.

    Now consider the STL stack. It can be implemented in terms of any sequence
    container that supports 'back', 'push_back' and 'pop_back', and it works
    outwardly in the same way with 'vector', 'list' or 'deque'.

    Alwyn


  • Next message: Artie Gold: "Re: segememtation fault with fclose"