In computer science, a hashed array tree (HAT) is a dynamic array data-structure published by Edward Sitarski in 1996, maintaining an array of separate memory fragments (or "leaves") to store the data elements, unlike simple dynamic arrays which maintain their data in one contiguous memory area. Its primary objective is to reduce the amount of element copying due to automatic array resizing operations, and to improve memory usage patterns.
Whereas simple dynamic arrays based on geometric expansion waste linear (Ω(n)) space, where n is the number of elements in the array, hashed array trees waste only order O(n1/2) storage space. An optimization of the algorithm allows to eliminate data copying completely, at a cost of increasing the wasted space.
It can perform access in constant (O(1)) time, though slightly slower than simple dynamic arrays. The algorithm has O(1) amortized performance when appending a series of objects to the end of a hashed array tree. Contrary to its name, it does not use hash functions.
Read more about Hashed Array Tree: Definitions, Expansions and Size Reductions, Related Data Structures
Famous quotes containing the words array and/or tree:
“Any one who knows what the worth of family affection is among the lower classes, and who has seen the array of little portraits stuck over a labourers fireplace ... will perhaps feel with me that in counteracting the tendencies, social and industrial, which every day are sapping the healthier family affections, the sixpenny photograph is doing more for the poor than all the philanthropists in the world.”
—Macmillans Magazine (London, September 1871)
“Blessed is the man that walketh not in the counsel of the ungodly,
nor standeth in the way of sinners, nor sitteth in the seat of the
scornful.
But his delight is in the law of the Lord; and in his law doth he
meditate day and night.
And he shall be like a tree planted by the rivers of water, that
bringeth forth his fruit in his season; his leaf also shall not wither;
and whatsoever he doeth shall prosper.”
—Bible: Hebrew Psalm I (l. I, 13)