Abstract Data Type - Typical Operations

Typical Operations

Some operations that are often specified for ADTs (possibly under other names) are

  • compare(s,t), that tests whether two structures are equivalent in some sense;
  • hash(s), that computes some standard hash function from the instance's state;
  • print(s) or show(s), that produces a human-readable representation of the structure's state.

In imperative-style ADT definitions, one often finds also

  • create, that yields a new instance of the ADT;
  • initialize(s), that prepares a newly created instance s for further operations, or resets it to some "initial state";
  • copy(s,t), that puts instance s in a state equivalent to that of t;
  • clone(t), that performs snew, copy(s,t), and returns s;
  • free(s) or destroy(s), that reclaims the memory and other resources used by s;

The free operation is not normally relevant or meaningful, since ADTs are theoretical entities that do not "use memory". However, it may be necessary when one needs to analyze the storage used by an algorithm that uses the ADT. In that case one needs additional axioms that specify how much memory each ADT instance uses, as a function of its state, and how much of it is returned to the pool by free.

Read more about this topic:  Abstract Data Type

Famous quotes containing the words typical and/or operations:

    It is not however, adulthood itself, but parenthood that forms the glass shroud of memory. For there is an interesting quirk in the memory of women. At 30, women see their adolescence quite clearly. At 30 a woman’s adolescence remains a facet fitting into her current self.... At 40, however, memories of adolescence are blurred. Women of this age look much more to their earlier childhood for memories of themselves and of their mothers. This links up to her typical parenting phase.
    Terri Apter (20th century)

    A sociosphere of contact, control, persuasion and dissuasion, of exhibitions of inhibitions in massive or homeopathic doses...: this is obscenity. All structures turned inside out and exhibited, all operations rendered visible. In America this goes all the way from the bewildering network of aerial telephone and electric wires ... to the concrete multiplication of all the bodily functions in the home, the litany of ingredients on the tiniest can of food, the exhibition of income or IQ.
    Jean Baudrillard (b. 1929)