{"id":16609614,"url":"https://github.com/polygonal/ds","last_synced_at":"2025-10-29T17:30:18.099Z","repository":{"id":3619905,"uuid":"4685589","full_name":"polygonal/ds","owner":"polygonal","description":"A Haxe library containing data structures for games.","archived":false,"fork":false,"pushed_at":"2023-01-22T19:36:46.000Z","size":8427,"stargazers_count":345,"open_issues_count":16,"forks_count":79,"subscribers_count":32,"default_branch":"master","last_synced_at":"2024-10-12T01:29:53.398Z","etag":null,"topics":["cross-platform","data-structures","haxe"],"latest_commit_sha":null,"homepage":"","language":"Haxe","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/polygonal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-06-16T15:46:24.000Z","updated_at":"2024-09-07T07:33:07.000Z","dependencies_parsed_at":"2023-02-12T18:00:40.450Z","dependency_job_id":null,"html_url":"https://github.com/polygonal/ds","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polygonal%2Fds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polygonal%2Fds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polygonal%2Fds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polygonal%2Fds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/polygonal","download_url":"https://codeload.github.com/polygonal/ds/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238855982,"owners_count":19542120,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cross-platform","data-structures","haxe"],"created_at":"2024-10-12T01:29:10.159Z","updated_at":"2025-10-29T17:30:17.433Z","avatar_url":"https://github.com/polygonal.png","language":"Haxe","funding_links":[],"categories":["Haxe","Miscellaneous"],"sub_categories":["Data structures"],"readme":"# Data Structures For Games\n\n![ds logo](./logo.svg)\n\nThe library contains parametrized classes that allow programmers to easily implement standard data structures like linked lists, queues, stacks or multi-dimensional arrays. The result is somewhere in between the C++ STL (Standard Template Library) and the Java Collection framework.\n\n## Documentation\n\n- API [http://polygonal.github.io/ds/polygonal/ds/index.html](http://polygonal.github.io/ds/polygonal/ds/index.html)\n- Slides [Introduction to ds - Data Structures For Games](http://polygonal.github.io/ds/2012_01_11_introduction_to_ds.pdf)\n\n## Cross-Platform Support\n\nds supports the following Haxe compilation targets: __-swf, -js, -neko, -python, -php, -cpp__\n\n__-hl__, __-java__, __-cs__, __jvm__ are experimental.\n\n## Installation\n\nInstall [Haxe](http://haxe.org/download) and run `$ haxelib install polygonal-ds` from the console, then compile with `$ haxe ... -lib polygonal-ds`.\n\n## Conditional Compilation Flags\n\n`-D generic`\n\nEnables generic classes (adds @:generic meta).\nNice performance boost for static typed platforms (-swf,-cpp only).\n\n`-D alchemy`\n\nEnables fast virtual memory for FP10+ (\"alchemy memory\"). Extra performance for Flash.\n\n## Changelog\n\n### 2.2.0 (wip)\n\n- **all: removed polygonal package structure**\n- fixed: Graph.removeSingleArcs(), removeMutualArcs()\n- modified: More conservative inlining (use selective inlining when actually needed)\n- modified: Use implicit casting for Comparables\n- added: Bitfield abstract\n- modified: ArrayTools.pairwise length parameter\n- modified: Added GraphNode.visible (quickly hide node from graph without disconnecting it)\n- modified: Added Array2.flipHorizontal, Array2.flipVertical\n- modified: Added ArrayTools.random()\n- modified: Added Array2.shiftRowLeft, Array2.shiftRowRight\n- modified: Added GraphNode.forEeachNeighbor()\n- all: Small fixes and optimizations\n\n### 2.1.1 (released 2019-11-10)\n\nSupports Haxe Compiler 4.0.1, hxcpp 4.0.64\n\n- **modified: require Haxe 4.0.0 (Haxe 3.x no longer maintained)**\n- added: RadixSort helper class\n- added: ArrayList.bruteforce()\n- added: ArrayTools.bruteforce()\n- fixed: Graph.dlbfs(): incorrect GraphNode.parent pointer\n- added: Bits.swap()\n- modified: Graph.removeArc(): add optional mutual parameter\n- added: ArrayTools.forEach()\n- added: ArrayList.addNativeArray()\n- added: FreeList helper class (tools package)\n- added: ArrayList.pairwise()\n- modified: removed var shadowing warnings (-D warn-var-shadowing)\n- modified: moved mem package to tools package\n- modified: Array2.countNeighbors(): add manhatten parameter\n- added: TreeTools.ofIndentedList()\n- added: TreeTools.randomTree()\n- added: TreeTools.map()\n- modified: trim package to polygonal.ds\n- added: ArrayList.resize()\n- fixed: ArrayList.reverse()\n- added: compile with `-D no-assert` to remove assert statements even when compiling with `-debug`\n- added: compile with `-D runtime_assert` to use non-macro asserts (faster)\n- modified: ArrayTools.equals(): now passing equals function as argument\n\n### 2.0.1 (released 2017-10-10)\n\nSupports Haxe Compiler 3.4.4, hxcpp 3.4.188\n\n- modified: HashKey: allow static initializers for non-static targets\n- added: Array2.Array2Cell.of()\n- modified: renamed M to MathTools\n- modified: removed unused imports/vars\n- added ArrayTools.pairwise()\n- added Array2.countNeighbors()\n- added wrap=true parameter to Array2.shift* methods\n\n### 2.0.0 (released 2017-01-31)\n\nSupports Haxe Compiler 3.4.0, hxcpp 3.4.49\n\n- added: Array2.copy()\n- modified: optimized Array2.resize(): use fast blit when only changing #rows\n- modified: optimized ArrayList.remove(): remove multiple values at once, use fast blit\n- modified: added ArrayTools.swap()\n- modified: added ArrayTools.getFront()\n- modified: added ArrayTools.iter()\n- added: ArrayList.addArray()\n- added: Array2.getIndexAtCell()\n- fixed: Array2.clear(), Array3.clear()\n- added: ArrayList.addArray()\n- added: ArrayList.insertionSort()\n- modified: allow more method chaining\n- modified: Sll/Dll: popDown() =\u003e tailToHead(), shiftUp() =\u003e headToTail()\n- added: tools.Shuffle for customizing Math.random() rng\n- fixed: integer hash tables print all key,value pairs for duplicate keys\n\n### 2.0.0-rc1 (released 2016-11-05)\n\nSupports Haxe Compiler 3.4.0-rc1, hxcpp 3.4.2\n\n- modified: replaced GraphArc.cost with a more versatile GraphArc.userData field\n- added: Graph.serialize() and Graph.unserialize()\n- added: implemented iter(), fast alternative to iterator()\n- modified: inline and optimize forEach()\n\n### 2.0.0-beta (released 2016-05-24)\n\n- modified: replaced pooling package with lightweight de.polygonal.ds.tools.ObjectPool class\n- modified: removed some Bits methods (better suited for abstract), move Bits class to tools package\n- modified: BitVector: use getters for size/capacity\n- modified: better method naming: don't use abbreviations\n- modified: renamed Graph methods (DFS, BFS, DLBFS =\u003e dfs, bfs, dlbfs)\n- modified: added Set.unset() method\n- modified: remove .swc files- no longer maintained (use tools/swc/run.bat to create swc libs on your own)\n- added: List\\\u003cT\\\u003e interface (implemented by ArrayList, Sll, Dll)\n- modified: replaced de.polygonal.ds.Vector typedef with NativeArray\\\u003cT\\\u003e type.\n- added: NativeArrayTools: helper class for working with fast platform specific native arrays.\n- modified: arrayed structures now use fast platform specific \"native arrays\" (vectors) for internal storage\n- added: replaced Da structure with new ArrayList implementation (resizable native array)\n- modified: renamed swp() =\u003e swap(), cpy() =\u003e copy()\n- modified: Map.clr() renamed to Map.unset() to distinguish from Collection.clear()\n- modified: optimized toString()\n- added: various growth rates for vector-based structures (see GrowthRate)\n- modified: Array2/3: getW(), getH(), getD() is now a property: width, height, depth\n- modified: removed ArrayConvert due to issues with -D generic, instead added ?source:Array\\\u003cT\\\u003e to constructor\n- modified: removed toVector() method\n- modified: renamed ArrayUtil to ArrayTools: match Haxe naming style\n- modified: iter() renamed to forEach() and implement for all structures\n- modified: removed redundant assign() and fill() methods: use forEach() instead\n- modified: size() is now a property: Collection.size\n- fixed: haxelib package\n- modified: greatly improved performance for static platforms when compiled with -D generic (-swf and -cpp only)\n- modified: cpp target: increase performance by skipping bounds checking when accessing arrays internally\n- fixed: always increment iterator state inside next()\n- added: support python and php target\n- fixed: Graph.remove()\n- modified: require flash10; drop support for fp 9.x\n- added: IntIntHashTable.hasPair() for checking if a {key, value} pair exists\n- added: IntIntHashTable.clrPair() for removing a {key, value} pair\n- added: IntIntHashTable.toKeyVector()\n- added: Array.getRect() for extracting a rectangular region\n- modified: use access control instead of friend sytax with typedef\n- modified: less aggressive inlining\n- modified: use plain array to pass random values to shuffle() instead of Da\n- fixed: several bug fixes for neko/cpp\n- modified: switched to dox for documentation\n- modified: renamed SLL to Sll, DLL to Dll, BST to Bst: match Haxe naming style\n- modified: removed HashMap class (deprecated, Flash only)\n\n### 1.4.1 (released 2013-07-08)\n\n- modified: removed \"polygonal-core\" haxelib dependency\n\n### 1.4.0 (released 2013-06-28; Haxe 3.0.0)\n\nSupports Haxe Compiler 3.0.0\n\n- modified: support Haxe 3 only (Haxe 2.x and Neko 1.x are no longer supported)\n- modified: sacrifice Collection.toDA() for proper @:generic support\n- modified: explicitly allocate elements in ArrayUtil.alloc() when targeting neko\n- fixed: several fixes when compiling with -D generic\n- modified: change BitVector to use the haxe.ds.Vector as data\n- modified: ArrayUtil.shrink(): trim when targeting cpp\n- modified: ArrayUtil.alloc(): explicitly allocate elements when targeting cpp\n- modified: more conservative inlining\n- modified: don't allocate stack arrays when doing iterative pre/post-order traversals\n- modified: optimized TreeNode.contains()\n- modified: optimize TreeNode.levelOrder by using an implicit queue\n- modified: all: fill() method returns this for chaining\n\n### 1.39 (released 2013-02-12)\n\nSupports Haxe Compiler 2.10 \u0026 Haxe 3.00 r6189\n\n- fixed: swc files: get rid of warnings for Flash Builder 4.7 + falcon compiler\n- fixed: cpp + blackberry target\n- fixed: some Haxe 3 fixes\n\n### 1.38 (released 2013-01-27)\n\n- modified: swc: moved Haxe classes to hx package\n- added: serialization of TreeNode structures (de.polygonal.ds.Serialization)\n- fixed: minor fixes for -D haxe3\n- added: ArrayUtil.equals()\n- added: IntIntHashTable, IntHashTable, HashTable.getAll()\n- fixed: IntIntHashTable.remove()\n- added: BitVector.getBucketAt(), getBuckets()\n- modified: replaced DA.swapWithBack() with DA.swapPop()\n- added: ArrayUtil.split()\n- fixed: TreeNode.removeChildren()\n- added: unit tests\n- added: support Neko 2.0 RC (compile with -D neko_v2)\n\n### 1.37 (released 2012-11-15)\n\n- modified: Graph: added Graph.borrowArc() and Graph.returnArc() to allow optional arc pooling\n- fixed: TreeNode.isAncestor(), TreeNode.isDescendant()\n- fixed: LinkedObjectPool: object instantiation for non-flash targets\n- added: ArrayUtil.quickPerm(): counting quickperm algorithm\n\n### 1.36 (released 2012-07-25)\n\n- added: TreeNode.isAncestor()\n- added: TreeNode.isDescendant()\n- added: TreeNode.getChildIndex()\n- modified: TreeNode.preorder, postorder: allow node removal during traversal\n- fixed: PriorityQueue.toString(): now prints elements in sorted order\n- modified: faster debugging with --no-inline through macro-based asserts\n- fixed: DA.inRange()\n- added: DLL.createNode(), DLL.appendNode(), DLL.prependNode()\n- fixed: typo Bitflags.setiff() =\u003e setfif()\n- added: TreeNode.insertChildAt()\n- added: TreeNode.removeChildAt()\n- added: TreeNode.setChildIndex()\n- added: TreeNode.swapChildren()\n- added: TreeNode.swapChildrenAt()\n- fixed: TreeNode.insertAfterChild(), insertBeforeChild()\n- modified: TreeNode.numChildren() is now O(1)\n- added: TreeNode.removeChildren()\n- added: TreeNode.setStack()\n- modified: TreeNode.getChildAtIndex() =\u003e TreeNode.getChildAt()\n- modified: cpp/nme target: now supporting MemoryManager\n- added: XmlConvert.toTreeNode(): xml =\u003e TreeNode conversion\n- added: Array2.copyCol(), Array2.swapCol()\n- added: Array2.copyRow(), Array2.swapRow()\n- fixed: support Haxe 2.10\n- modified: also dump state with toString() in release mode\n- fixed: DA.sort() out of bound access\n- fixed: BitVector.ofBytes for neko\n\n### 1.35 (released 2011-12-22)\n\n- modified: Collection.clone(): make assign parameter optional so clone() does a shallow copy per default\n- added: Array2.setNestedArray()\n- added: TreeNode.getChildAtIndex()\n- added: include Lambda class in swc files (\u003chttp://haxe.org/api/lambda\u003e)\n- added: TreeNode.childIterator()\n- fixed: Heap.remove(), PriorityQueue.remove()\n- fixed: Collection.toVector()\n- modified: Heap.remove(), PriorityQueue.remove() is now O(1)\n\n### 1.34 (released 2011-10-26)\n\n- added: all: Collection.toVector() for FP10+\n- modified: too many issues with -D swf-protected so revert back to prefixing private members with underscore\n\n### 1.33 (released 2011-10-21)\n\n- modified: disabled haxe.rtti.Generic optimization by default, enable with -D 'generic' (replaces 'no_rtti' flag)\n- fixed: DynamicObjectPool: 'object x was returned twice to the pool' assert\n- added: DynamicObjectPool.used()\n- added: Compare.lexiographic()\n- added: Bits.unpackUI16Lo(), unpackUI16Hi()\n- fixed: DLL.lastNodeOf()\n- fixed: TreeNode.levelOrder\n- modified: ObjectPool: allow lazy allocation by using ObjectPool.allocate(true, ...)\n- added: ArrayedDeque.indexOfFront(), indexOfBack()\n- added: LinkedDeque.indexOfFront(), indexOfBack()\n- fixed: HashMap.toArray()\n- added: BitVector.clrRange(), setRange()\n- added: Array2.inRange(), Array3.inRange()\n- added: Array2.getAt(), Array3.getAt()\n- fixed: MemoryAccess.swp()\n- fixed: PriorityQueue.reprioritze(): use float type for priority value\n- fixed: HashSet remove obsolete \\\u003cK\\\u003e type parameter\n- added: all except TreeNode+BinaryTreeNode: added reuseIterator flag\n- modified: by default alchemy memory optimization is now disabled, enable with -D alchemy (removed -D 'no_alchemy')\n- added: support for Itr.remove()\n- added: DynamicObjectPool.maxUsageCount()\n- modified: swc: compiled with Haxe 2.08\n- modified: swc: only show public API (all private fields marked with an underscore are now protected)\n\n### 1.32 (released 2011-07-17)\n\n- fixed: LinkedObjectPool.get()\n- added: Array2.getAtIndex()\n- added: Array2.setAtIndex()\n- fixed: HashMap.remove(x): now removes all keys that map the value x\n- fixed: BinaryTreeNode docs\n- fixed: Graph.DFS(), Graph.BFS(): include seed in traversal when preflight flag is set\n- fixed: IntHashTable memory leak\n- modified: added MemoryAccess.name for better debugging/profiling\n- fixed: LinkedQueue.remove() infinite loop in edge cases\n- modified: IntHashSet, HashSet, IntIntHashTable, IntHashTable, HashTable.clear(): only shrink container if purge=true\n- fixed MemoryManager OOM error when calling realloc\n- added: BitMemory.get()\n- fixed: ArrayedDeque.iterator()\n- changed: Itr.next() now returns a reference to itself\n- fixed: Graph.unlink()\n- modified: added Graph.removeNode()\n- fixed: HashMap.remap()\n- fixed: HashTable, IntHashTable, IntIntHashTable.toString()\n- fixed: HashSet, IntHashTable, IntHashTable.clear()\n- fixed: LinkedStack.clear()\n- fixed: Graph.remove(): update size when removing node\n- added: DA.inRange(): check if given index is valid\n- fixed: DA.sort() using quick sort\n- modified: GraphNode: added traversal depth and parent pointer\n- modified: Graph: cost is now optional (default is 1.0)\n- modified: changed Graph.addNode() to allow sub-classing of GraphNode objects\n- fixed: various fixes for the cpp target\n- added: Graph.autoClearMarks\n- modified: de.polygonal.ds.mem package now works with hxcpp+NME \"alchemy\" memory\n- added: Graph.DLBFS(): depth-limited breadth-first search\n- fixed: DLL.sort: merge sort produced invalid prev pointers\n- modified: optimized TreeNode class\n- modified: added support for circular singly linked lists\n- fixed: Graph.free(): infinite loop lockup\n- fixed: TreeNode.free(): also nullify parent and val field\n- fixed: SLL.nodeOf(): always returned null\n- modified: support circular singly linked lists\n- fixed: DLL.free(), clear(): infinite loop lockup\n- fixed: DLL.clone(): preserve circular property\n- modified: PriorityQueue: use float type for storing priority value\n- modified: DA.sort(): support range sorting\n- added: ArrayUtil.sortRange()\n- modified: document complexity\n- fixed: ArrayQueue.fill(), assign() for js target\n\n### 1.31 (released 2011-04-11)\n\n- modified: better AS3/SWC support: removed some redundant classes, haxe.init(mc) is no longer required\n- added: TreeNode.sort()- sort children\n- added: preflight flag for TreeNode.preorder- exclude subtree from traversal\n- modified: improved TreeNode and BinaryTreeNode iterative traversal performance\n- fixed PriorityQueue.clear(), dequeue(), remove()\n- fixed: Heap.remove()\n- modified: improved Heap performance\n- modified: Heap.enqueue(), dequeue(), front() renamed to Heap.add(), pop(), top()\n- modified: added Heap.replace(), change(), sort(), bottom(), repair(), height()\n- added: Heapable interface\n- modified: PriorityQueue now implements Queue interface\n- modified: added PriorityQueue.back()\n- fixed: some neko compatibility fixes\n- added: optional binary search for DA.indexOf()\n- added: ArrayUtil.shrink()\n- modified: ArrayUtil.bsearchInt/bsearchFloat/bsearchComparator: now returns insertion point instead of just -1\n- added: Bits.next(): macro based bit flag generation\n\n### 1.30 (released 2011-03-03)\n\n- modified: GraphNode and GraphArc now implement Hashable\n- fixed: DA.reverse()\n- added: Graph.nodeIterator(), Graph.arcIterator()\n- modified: renamed GraphNodeIterator to NodeValIterator\n- added: GraphNode.getArcCount()\n- fixed: return value of Array.getRow(), getCol(), getPile()\n- fixed: TreeBuilder.nextChild(),prevChild()\n- added: TreeBuilder.hasNextChild(), hasPrevChild()\n- fixed: Bits.ntz(): removed static initializer for swc compatibility\n- fixed: Array3.setCol(), setPile()\n- added: TreeNode.getFirstChild(), TreeNode.setFirst(), TreeNode.setLast()\n- fixed: renamed TreeNode.getChildIndex() to TreeNode.getSiblingIndex()\n- fixed: BST: nullify tree if empty\n- added: ArrayedQueue.pack()\n- modified: HashMap: don't allow null keys and null values\n- added: Deque\\\u003cT\\\u003e interface\n- added: LinkedDeque\\\u003cT\\\u003e: linked deque implementation\n- added: ArrayedDeque\\\u003cT\\\u003e: arrayed deque implementation\n\n### 1.23 (released 2011-01-30)\n\n- added: DynamicObjectPool\n- modified: moved Factory to de.polygonal.ds\n- added: ArrayedStack/LinkedStack: dup(), exchange(), rotRight(), rotLeft()\n- added: MemoryManager.size()\n- modified: Collection.iterator() changed to Collection.itr() (unify AS3/Haxe)\n- modified: Hashable.getKey() changed to Hashable.key for SWC also (unify AS3/Haxe)\n- modified: removed various C++ workarounds that are no longer needed in Haxe 2.07\n- fixed: incorrect maxSize value in release builds\n- modified: IntHashTable/HashTable/HashSet/HashMap: removed nullValue, use Null\\\u003cT\\\u003e instead\n- fixed: Bits.ntz() and Bits.setBits() for js target\n- added: SLLNode/DLLNode.isHead(), isTail()\n- fixed: Flash AVM1 support\n- modified: ArrayedQueue is now dynamic\n- modified: SWC files compiled with Haxe 2.07\n\n### 1.22 (released 2011-01-11)\n\n- added: TreeNode levelorder traversal\n- added: MemoryManager: automatically reclaim memory when MemoryAccess object is GCed\n- added: ArrayUtil.assign()\n- added: IntIntHashTable.extract()\n- modified: Collection now implements Hashable\n- fixed: Bits.flipDWORD()\n- modified: allow ByteArray access from MemoryManager\n- added: Da.getNext(), DA.getPrev()\n- modified: refactoring of Assert statements\n- modified: optimized MemoryAccess.fill()\n- fixed: IntIntHashTable shrink segmentation fault\n- fixed: IntIntHashTable set() return value\n- modified: improved MemoryManager defrag performance\n- modified: renamed DA.move() to memmove() and improved performance\n- modified: improved ArrayUtil.memmove()\n- added: MemoryManager.memmove()\n- modified: improved documentation\n- modified: maxSize() is now a property\n- added: ByteMemory.clone()\n- fixed: MemoryManager issues when using SWC files- static getters are now static functions\n- fixed: Bits.hasBitAt()\n- modified: updated documentation\n- modified: simplified ArrayConvert class\n\n### 1.21 (released 2010-12-12)\n\n- added: HashTable.dispose()\n- fixed: don't skip constructor call in assign() methods\n- fixed: Bits class\n- fixed: SLL/DLL node caching\n- added: DA.swapWithBack()\n- fixed: DA.join()\n- added: IntIntHashTable.count()\n- fixed: IntIntHashTable infinite loop trap when resizing\n- fixed: ObjectPool.iterator() for non-allocated pools\n- modified: ObjectPool: improved performance, smaller memory footprint\n- modified: IntIntHashTable/IntHashTable/HashTable/IntHashSet/HashSet: added resizable parameter to constructor (enforce fixed size)\n- added: BitFlags helper class\n\n### 1.20 (released 2010-11-01)\n\n- fixed: C++ and JavaScript compatibility\n- added: IntIntHashTable: an array hash table implementation using 32-bit integers for keys and values\n- added: IntHashTable\\\u003cT\\\u003e: a generic hash table using 32-bit integers for keys\n- added: HashTable\\\u003cK, T\\\u003e: a generic hash table\n- added: IntHashSet: a hash set for 32-bit integer values\n- added: HashSet\\\u003cT\\\u003e: a generic hash set\n- added: added Map interface\n- added: added Set interface (Set replaced with ListSet)\n- added: Hashable interface\n- added: HashableItem abstract helper class\n- added: HashKey class\n- added: ListSet: simple replacement for the Set class which was using the flash.utils.Dictionary class.\n- modified: Collection.toArray(?output:Array\\\u003cT\\\u003e):Array\\\u003cT\\\u003e changed to Collection.toArray():Array\\\u003cT\\\u003e (c++ compatibility)\n- modified: Collection.toDA(?output:DA\\\u003cT\\\u003e):Array\\\u003cT\\\u003e changed to Collection.toDA():DA\\\u003cT\\\u003e (c++ compatibility)\n- modified: HashMap refactoring; HashMap\\\u003cK, V\\\u003e now  implements Map\\\u003cK, T\\\u003e instead of Collection\\\u003cK\\\u003e\n\n### 1.12 (released 2010-10-18)\n\n- fixed: ArrayedQueue.remove(),dispose()\n- fixed: LinkedObjectPool.put()\n- fixed: SLL.merge()\n- fixed: Graph.BFS()\n- modified: SLL/DLL/LinkedStack/LinkedQueue: structures can be created with a reserved size (increases performance at the cost of memory usage through object pooling)\n- fixed: revised dense array (DA)\n- modified: added iterative Graph.DFS()\n- fixed: LinkedQueue.clone()\n- fixed: ArrayedQueue.isFull()\n- fixed: PriorityQueue.toString()\n- fixed: MemoryManager: remember existing 1024 bytes after initialization\n- fixed: TreeNode.postOrder()\n- modified: split assign(x:Dynamic) into fill(x:T) and assign(x:Class\\\u003cT\\\u003e) because of type safety, performance and cross-platform compatibility\n- some fixes for js/cpp target\n- added: MemoryAccess.clone()\n- added: MemoryAccess.fill()\n- added: MemoryAccess.resize()\n- added: ArrayTools class\n- fixed: several cross-platform issues for de.polygonal.ds.mem when compiled with -D no_alchemy\n\n### 1.11 (released 2010-07-22)\n\n- added: ObjectPool.isEmpty()\n- added: Array2\u00263: getIndex(), cellToIndex(), indexToCell(), indexOf(), cellOf()\n- added: Bits.flipWORD and Bits.flipDWORD\n- modified: MemoryManager: default block size is now 64 KiB\n- modified: Set is now cross-platform\n- code style: SLL/DLL: head and tail are now properties\n- modified: SLL/DLL/SLLNode/DLLNode: renamed remove() to unlink() since remove(x:T) is now part of the Collection interface\n- modified: Graph: renamed removeNode() to unlink() since remove(x:T) is now part of the Collection interface\n- modified: de.polygonal.ds.mem.*: added FP9 compatibility when using -D no_alchemy\n- fixed: ShortMemory/IntMemory/FloatMemory/DoubleMemory ofByteArray() endianness\n- added: TreeNode: unlink(), prependNode(), appendNode(), insertAfterChild(), insertBeforeChild(), numNextSiblings(), numPrevSiblings()\n- added: BinaryTreeNode.unlink()\n- modified: renamed Vector to DA (dense array) to avoid confusion with flash's built in Vector class. As a consequence, Collection.toVector() changed to Collection.toDA(), and HashMap.valuesToVector() changed to HashMap.valuesToDA()\n- added: ArrayedStack/Heap/PrioriyQueue/DA.reserve(): If size is known in advance storage can be preallocated to increase performance/reduce memory usage. This is automatically done for fixed-size structures (\u003chttp://jpauclair.net/2009/12/05/tamarin-part-ii-more-on-array-and-vector/\u003e).\n- code style: compact() changed to pack() (prefer shorter names)\n- added: Collection.free(): 'Deconstructor' that nullifies all references (optimizes memory usage and results in faster garbage collection)\n- added: Collection.remove(x:T): Removes all occurrences of x from a collection\n- modified: Collection.clear() changed to Collection.clear(?purge = false)\n- added: ArrayedStack.dispose(): Nullifies reference to popped element for GC\n- modified: Set/HashMap: removed setIfAbsent() and removeIfExists() (merged into set() and remove())\n- modified: improved Collection.toArray()/Collection.toDA()\n- modified: swc files only: Collection.iterator():Object now typed to Collection.iterator():Itr\n\n### 1.1 (released 2010-03-15)\n\n- added: TreeNode.getChildIndex()\n- fixed: LinkedStack.clear()\n- fixed: LinkedStack.toArray()/toVector()\n- added: Stack interface (implemented by ArrayedStack/LinkedStack)\n- added: Queue interface (implemented by ArrayedQueue/LinkedQueue)\n- fixed: TreeBuilder.removeChild()\n- modified: removed superfluous type parameter from Visitable interface\n- modified: enhanced Bits class (new methods + cross platform compatibility)\n- modified: enhanced BitVector class (cross platform compatibility)\n- added: new MemoryManager (\u003chttp://lab.polygonal.de/2010/03/04/memorymanager-revisited\u003e)\n- added: ShortMemory for storing 16bit integers.\n- fixed: BitVector.ofBytes\n\n### 1.06 (released 2010-01-31)\n\n- added: ArrayConvert helper class\n- added: ArrayedQueue, ArrayedStack, Vector: swp() and cpy() methods\n- added: LinkedStack, LinkedQueue, SLL, DLL: size constraint when compiled with -debug\n- modified: ArrayedQueue, ArrayedStack, Vector: renamed getAt()/setAt() to get()/set()\n- modified: SLL.nodeOf(): from parameter is now optional (matches DLL.nodeOf())\n- fixed: ArrayedStack.push(): maxSize() assert not fired\n- fixed: Vector.pushBack, pushFront(), insertAt(): maxSize() assert not fired\n- modified: SLL, DLL.remove(node): returns the next node in the list\n- fixed: Vector.iterator()#reset()\n- fixed: Bits.hasAllBits()\n- code style: type inference for optional parameters\n- modified: small optimization in TreeNode.preorder and TreeNode.postorder\n- fixed: TreeNode/Graph/BinaryTreeNode: invalid stack for iterative preorder/inorder/postorder traversals (called from within visit()/process())\n- fixed: TreeNode/Graph/BinaryTreeNode: preorder/inorder/postorder: now accepts optional user data that is passed to every visited node\n- modified: TreeWalker.appendChild(),prependChild(),insertBeforeChild(),insertAfterChild(): now returns the node object storing the child\n- fixed: TreeWalker.new(): wrong vertical pointer\n- added: TreeNode.getRoot(): finds the root of the tree\n- added: Graph.isMarked()\n- added: BitMemory/DoubleMemory/FloatMemory/IntMemory: getIndex(i:Int): memory byte offset for value at index i\n- code style: different 'friend' syntax that ensures strict typing for improved performance (\u003chttp://www.weblob.net/2010/01/friend-types-are-slow-really\u003e)\n- modified: Graph: added maxSize() constraint() for debugging\n\n### 1.05 (released 2009-12-24)\n\n- all: interfaces can be accessed in swc files\n- all: parameter names are now available in swc files\n- all: switched from flash.Vector to Array for now because a dynamic array (used in swc files) is faster than a dynamic vector and alchemy memory is much faster than typed number vectors.\n- all: iterators now implement de.polygonal.ds.Itr\\\u003cT\\\u003e (to distinguish between the built-in Iterator typedef)\n- all: iterators can be reused by calling iterator.reset() when typed to ResettableIterator\\\u003cT\\\u003e or Itr\\\u003cT\\\u003e\n- all: enhanced assign(): collection can be filled entirely/partially with elements\n- all: enhanced shuffle(): now accepts external random values so different RNG/PRNG can be used.\n- all: enhanced Collection.toArray() and Collection.toVector()\n- all: minor documentation improvements\n- added: Vector collection (growable dense array) as a more advanced Array/Vector replacement (no performance degradation in Haxe).\n- added: compact() method for growable collections that use an array (ArrayedStack, Heap, PriorityQueue, Vector)\n- added: TreeNode.find()\n- added: Bits.hx class (much nicer/faster with 'using' syntax) as a replacement for BitField.hx\n- added: -D no_rtti compiler flag (disables haxe.rtti.Generic)\n- modified: Graph.size(), HashMap.size() and Set.size(): now O(c) instead of O(n)\n- modified: removed size constraint from ArrayedStack, Heap and PriorityQueue (grows on demand)\n- modified: removed obsolete isFull()/capacity() methods\n- fixed: DLL insertionSort\n- fixed: MemoryManager.defragment() + minor improvements\n- fixed: graph.addSingleArc()\n- fixed: Array3.walk()\n- fixed: LinkedStack.iterator()\n- fixed: HashMap.toString()\n- fixed: ObjectPool.get()\n- fixed: TreeNode.height()\n- fixed: BST.height()\n- fixed: BST.toString()\n\n### 1.0 (released 2009-12-09)\n\n- Significant performance improvements compared to as3ds thanks to the Haxe compiler :)\n- Fixed most issues posted on the old as3ds google code projects page\n- Enhanced documentation\n- Supports \"alchemy memory\"\n- Collections can be cloned (shallow\u0026deep copy)\n- Some collections can be shuffled\n- Added support for circular doubly linked lists\n- Added object pooling library\n- Added iterative traversal algorithms\n- Added linked graph structure\n- Many small improvements I don't remember...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolygonal%2Fds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolygonal%2Fds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolygonal%2Fds/lists"}