List |
A list is a variable array that has n items whose size is variable, it has items that can be added or deleted.
A common way to set up a list is to define an array with a predetermined size, and insert the list within it..
This is fine for most cases, but you may then find that you reach the limit of a fixed array and you still wish to make insertions. Programming languages such as Pascal overcoming this problem by using a pointer.
A pointer, also called a link or reference, is defined to be a variable that gives the location of some other variable, typically of a record containing data that we wish to use. If we use pointers to locate all the records in which we are interested, then we need not be concerned about where the actual records themselves are actually stored, since by using a pointer, we can let the computer system itself locate the record when required.
There are in fact several ways to implement a list in memory and the programmer has to be conscious which one to choose. There are also several different kinds of list.
Linked List
A list in which data in an array is arranged maintained in logical order without being maintained in physical order. Given a starting point (here location number 2) we can read every record by following the attached pointer field.
A Linked List using an array (maintains Last name sort).

Using pointers this becomes;
|
in Pascal: type Note: in C a * is used to designate a pointer. |
Additions and deletions are achieved by simply adjusting the pointers - physical re-arrangement is not necessary.
A common list used in windows is the list box:
Using Active X (a web version of Visual Basic).
If we want to create a combo box to display a list of valid bases, we would;
1. Place the combo box object on our form.
2. When the form loads load in the values for the list, and assign a start value.
