Answers to questions on user defined types

  1. On average, is it quicker to find a particular element of an indexed list, like a set of pigeon holes, or an unsorted pile?
    Clearly the indexed approach allows you to find the correct element more quickly, on average.

  2. Why might it be useful to be able to define names for certain constant values?
    1. To make a program more readable.
    2. To allow the value to be changed by editing the definition in one place, rather than finding every occurence.
    3. To allow the compiler to check if we are using the name correctly (although C is not much help in that respect!)

Some answers to these questions.


Back to notes on user defined types.