Index mapping: Difference between revisions

Content deleted Content added
Yobot (talk | contribs)
m Tagging using AWB (10703)
Line 1:
{{multipleMultiple issues |
{{one source|date=January 2012 |}}
{{essay-like|date=January 2012}}
}}
'''Index mapping''' is a [[computer science]] term (also known as a "'''trivial [[hash function]]'''") that is used to describe the mapping{{clarification needed|date=January 2012}} of [[raw data]], used directly as in [[array index]], for an [[array data structure|array]]. The technique can be most effective for mapping data with a small range{{clarification needed|date=January 2012}}. If the array encompasses all combinations of input, a range check is not required.
 
'''Index mapping''' is a [[computer science]] term (also known as a "'''trivial [[hash function]]'''") that is used to describe the mapping{{clarification neededclarify|date=January 2012}} of [[raw data]], used directly as in [[array index]], for an [[array data structure|array]]. The technique can be most effective for mapping data with a small range{{clarification neededclarify|date=January 2012}}. If the array encompasses all combinations of input, a range check is not required.
==Applicable arrays==
 
In practice there are many examples of data exhibiting a small range of valid values all of which are suitable for processing{{clarification needed|date=January 2012}} using a trivial hash function including:
==Applicable arrays==
In practice there are many examples of data exhibiting a small range of valid values all of which are suitable for processing{{clarification neededclarify|date=January 2012}} using a trivial hash function including:
* [[month]] in the year (1–12) – see [[#C example 1|C examples]] below
* [[day]] in the month (1–31)
* [[day of the week]] (1–7)
* human lifespan{{clarification neededclarify|date=January 2012}} (0–130) – e.g. lifecover actuary tables, fixed term mortgage
* [[ASCII]] characters {{clarification neededclarify|date=January 2012}} (0–127), encompassing common mathematical operator symbols, digits, punctuation marks and English language alphabet
* [[EBCDIC]] characters {{clarification neededclarify|date=January 2012}} (0–255)
 
==Examples==
Line 33 ⟶ 37:
*[[Multiway branch]]
*[[lookup table]]
 
==References==
{{Reflist}}
 
==External links==
*[http://ols.fedoraproject.org/GCC/Reprints-2008/sayle-reprint.pdf A Superoptimizer Analysis of Multiway Branch Code Generation] by Roger Anthony Sayle
 
<!-- do interwikis exist? -->
 
[[Category:Arrays]]
Line 43 ⟶ 51:
[[Category:Hashing|*]]
[[Category:Search algorithms]]
 
<!-- do interwikis exist? -->