<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.formulasearchengine.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=173.228.57.67</id>
	<title>formulasearchengine - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://en.formulasearchengine.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=173.228.57.67"/>
	<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/wiki/Special:Contributions/173.228.57.67"/>
	<updated>2026-08-07T11:21:12Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.47.0-wmf.7</generator>
	<entry>
		<id>https://en.formulasearchengine.com/w/index.php?title=Minkowski%E2%80%93Hlawka_theorem&amp;diff=11414</id>
		<title>Minkowski–Hlawka theorem</title>
		<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/w/index.php?title=Minkowski%E2%80%93Hlawka_theorem&amp;diff=11414"/>
		<updated>2013-12-11T21:06:31Z</updated>

		<summary type="html">&lt;p&gt;173.228.57.67: /* See aolso */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Linear hashing&#039;&#039;&#039; is a dynamic [[hash table]] algorithm invented by Witold Litwin (1980),&amp;lt;ref&amp;gt;{{Citation | first1=Witold | last1=Litwin | title=Linear hashing: A new tool for file and table addressing | journal=Proc. 6th Conference on Very Large Databases | pages=212–223 | year=1980 | url=http://www.cs.cmu.edu/afs/cs.cmu.edu/user/christos/www/courses/826-resources/PAPERS+BOOK/linear-hashing.PDF|format=PDF}}&amp;lt;/ref&amp;gt; and later popularized by [[Paul Larson]]. Linear hashing allows for the expansion of the hash table one slot at a time.&lt;br /&gt;
The frequent single slot expansion can very effectively control the length of&lt;br /&gt;
the collision chain.  The cost of hash table expansion is spread out across each&lt;br /&gt;
hash table insertion operation, as opposed to being incurred all at once.&amp;lt;ref&amp;gt;{{Citation | first1=Per-Åke | last1=Larson | title=Dynamic Hash Tables | journal=Communications of the ACM | pages=446–457 | date=April 1988 | volume=31 | number=4 | doi=10.1145/42404.42410}}&amp;lt;/ref&amp;gt; Linear hashing is therefore well suited for interactive applications.&lt;br /&gt;
&lt;br /&gt;
==Algorithm Details==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
First the initial hash table is set up with some arbitrary initial number of buckets.  The following values need to be kept track of:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;: The initial number of buckets.&lt;br /&gt;
* &amp;lt;math&amp;gt;L&amp;lt;/math&amp;gt;: The current level which is an integer that indicates on a logarithmic scale approximately how much the table has grown.  This is initially &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;.&lt;br /&gt;
* &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;: The step pointer which points to a bucket.  It initially points to the first bucket in the table.&lt;br /&gt;
&lt;br /&gt;
Bucket collisions can be handled in a variety of ways but it is typical to have space for two items in each bucket and to add more buckets whenever a bucket overflows.  Addresses are calculated in the following way:&lt;br /&gt;
&lt;br /&gt;
* Apply a [[hash function]] to the key and call the result &amp;lt;math&amp;gt;H&amp;lt;/math&amp;gt;.&lt;br /&gt;
* If &amp;lt;math&amp;gt;H \bmod N \times 2^L&amp;lt;/math&amp;gt; is an address that comes before &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;, the address is &amp;lt;math&amp;gt;H \bmod N \times 2^{L+1}&amp;lt;/math&amp;gt;.&lt;br /&gt;
* If &amp;lt;math&amp;gt;H \bmod N \times 2^L&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; or an address that comes after &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;, the address is &amp;lt;math&amp;gt;H \bmod N \times 2^L&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To add a bucket:&lt;br /&gt;
&lt;br /&gt;
* Allocate a new bucket at the end of the table.&lt;br /&gt;
* If &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; points to the &amp;lt;math&amp;gt;N \times 2^L&amp;lt;/math&amp;gt;th bucket in the table, reset &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and increment &amp;lt;math&amp;gt;L&amp;lt;/math&amp;gt;.&lt;br /&gt;
* Otherwise increment &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The effect of all of this is that the table is split into three sections; the section before &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;, the section from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;N \times 2^L&amp;lt;/math&amp;gt;, and the section after &amp;lt;math&amp;gt;N \times 2^L&amp;lt;/math&amp;gt;.  The first and last sections are stored using &amp;lt;math&amp;gt;H \bmod N \times 2^{L+1}&amp;lt;/math&amp;gt; and the middle section is stored using &amp;lt;math&amp;gt;H \bmod N \times 2^L&amp;lt;/math&amp;gt;.  Each time &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; reaches &amp;lt;math&amp;gt;N \times 2^L&amp;lt;/math&amp;gt; the table has doubled in size.&lt;br /&gt;
&lt;br /&gt;
==Adoption in language systems==&lt;br /&gt;
Griswold and Townsend &amp;lt;ref&amp;gt;{{Citation | title=The Design and Implementation of Dynamic Hashing for Sets and Tables in Icon | first1=William G. | last1=Griswold | author1-link = Bill Griswold | first2=Gregg M. | last2=Townsend | journal=Software - Practice and Experience | volume=23 | issue=4 | date=April 1993 | pages=351–367 | url=http://citeseer.ist.psu.edu/griswold93design.html}}&amp;lt;/ref&amp;gt; discussed the adoption of linear hashing in the [[Icon language]]. They discussed the implementation alternatives of [[dynamic array]] algorithm used in linear hashing, and presented performance comparisons using a list of Icon benchmark applications.&lt;br /&gt;
&lt;br /&gt;
==Adoption in database systems==&lt;br /&gt;
Linear hashing is used in the BDB Berkeley database system, which in turn is used by many software systems such as OpenLDAP, using a C implementation derived from the CACM article and first published on the Usenet in 1988 by Esmond Pitt.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.concentric.net/~Ttwang/tech/sorthash.htm Sorted Linear Hash Table, C++ implementation of a Linear Hashtable]&lt;br /&gt;
*[http://tommyds.sourceforge.net/ TommyDS, C implementation of a Linear Hashtable]&lt;br /&gt;
*[http://hackthology.com/an-in-memory-go-implementation-of-linear-hashing.html An in Memory Go Implementation with Explanation]&lt;br /&gt;
* {{DADS|linear hashing|linearHashing}}&lt;br /&gt;
*[https://github.com/KevinStern/index-cpp/blob/master/src/linear_hashing_table.h A C++ Implementation of Linear Hashtable which Supports Both Filesystem and In-Memory Storage]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Extendible hashing]]&lt;br /&gt;
* [[Consistent hashing]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Search algorithms]]&lt;br /&gt;
[[Category:Hashing]]&lt;/div&gt;</summary>
		<author><name>173.228.57.67</name></author>
	</entry>
</feed>