Abstract Data Types
- Abstract data types or ADTs are a mathematical specification of a set of
data and the set of operations that can be performed on the data.
- We think of an abstract data type as a type defined in terms of its behavior
rather than its implementation.
Technically, we define an abstract data type as a mathematical object
and the operations on that object.
A string is a group of characters that are thought of as a single
The operations on strings include :
- finding its length
- copying one string into another
- comparing two strings for equality or for alphabetic ordering
Implementation of a string:
A string in C is an array of characters that is pointed to by a pointer
whose variable name is the name of the array. The string can be indexed
like other arrays. A string is special, because its last character has
to be the null terminator.
Strings have many operations on them. Those operations have been written
for us and are found in the string library.
Tuesday, 22-Aug-2006 07:14:12 EDT