The data structures that we use in applications often contain a great
deal of information of various types, and certian pieces of
information may be belong to multiple independent data structures. For
example, a file of personnel data may contain records with names,
addresses, and various other pieces of information about employees;
and each record may need to belong to one data structure for searching
for particular employees, to another data structure for answering
statistical queries, and so forth.Despite this diverstiy and complexity, a large class of computing
applications involve generic manipulation of data objects, and need
access to the information associated with them for a limited number of
specific reasons. Many of the manipulations that are required are a
natural outgrowth of basic computational procedures, so they are
needed in broad variety of applications. Many of the fundamental
algorithms can be applied effectively to the task of building a layer
of abstraction that can provide client programs with the ability to
perform such amanipulations efficiently. Thus we shall consider in
detail numerous ADT’s that are associated with such maniupulations.
They define various operations on collections of abstract objects,
independent of the type of the object.
Above text is described in context of abstract data types by Robert Sedwick in Algorithms in C++.
My questions are
What does author mean by “a large class of computing applications involve generic manipulation of data objects and need access to the information associated with them for a limited number of specific reasons.” ? Here what does author mean by generic manipulation and limited number of specific reasons?
What does author mean by “building a layer of abstraction ” so that client programs can perform such manipuations effieciently” ?
Thanks!
Generic manipulation is when you write code that can process some data without explicitly knowing what type of data it is, just how you can manipulate it.
Consider std::find from the C++ library:
This code works for any sequence that can provide an iterator (not just containers), and any type
Tthat can be passed by reference and compared using==.You don’t have to know anything else about
T.