First, AN EXAMPLE OF TABLE-Driven Method in P2
How to look up entries in the table1. Direct AccessFor example, you want to the days number for every month, store the days in an array and use month as the index.2. Indexed AccessWhen you use indexes, you use the primary data to look up a key in an index table and then you use the value from the index table to look up the main data you're interested in.3. Stair-Step AccessThe general idea of stair-step structure is that entries in a table are valid for ranges of data rather than for distinct data points.The stair-step approach categorizes each entry by determining the level at which it hits a "staircase". To use the stair-step method, you put the upper end of each range into a table and then write a loop to check a score against the upper end of each range. When you find the point at which the score first exceeds the top of a range, you know what the grade is. Watch the endpoints. Consider using a Binary Search Rather Than A Sequential Search. Consider Using Indexed ACC Ess Instead of the Stair-Step Technique. Put The Stair-Step Table Lookup ITO ITS OWN Routine.