| |
Data Structures and Algorithms | page 3 of 11 |
A scalar type is a simple data type which holds one value at a time. The data types int , double , char , and boolean are important and useful, but limited.
A data structure is a collection of scalar data types which are all referenced or accessed through one identifier.
Data structures can be created to store information about any real-world situation:
- Your high school transcript is a collection of grades.
- The English paper you wrote on a word processor is stored as a collection of characters, punctuation, and formatting codes.
- Your name, address, and phone number can be stored as a collection of strings.
After defining a data structure, algorithms will be needed to solve the specific problems associated with such a data structure.
One example of a data structure is an array. An array will store a list of values.
An algorithm is a sequence of programmed steps which solves a specific problem.
The fundamental algorithms which apply to an array data structure are: insertion, deletion, traversal, searching, and sorting.
|