ASLib is an ActionScript 2.0 based library that implements common data structures. This release contains the following data structures:
- Single Linked List
- Stack
- Queue
- Hash Table
- Binary Tree
Description:
- Single Linked List
The list is composed of list nodes, which can hold any data type in form of a Single Linked List Object. Default inserts are made at the head of the list. Nodes in the list have unique keys that can be used for data searches and or node removal.
- Stack:
The stack uses the single linked list for its internal structure. The stack is a regular "last-in, first-out", LIFO, structure. It can hold any data type in form of a StackObject.
- Queue:
The queue uses the single linked list for its internal structure. The queue is a regular "first-in, first-out", FIFO, structures. It can hold any data type in form of a QueueObject.
- HashTable:
The hash table uses an array of single linked lists. It can hold any data type in form of a HashTableObject. The HashTableObject's numeric key is used to hash to a linked list array location using the modulus on the object key and the array length. Once the single linked list array location is determined, a default insert at the front of the list is performed. The object key is not only used to determine the correct array hash location but also to find the object within a linked list while performing a search and or a removal of an object.
- BinaryTree:
The binary tree can hold any data type in from of a BinaryTreeObject that is wrapped in a Tree Node object that has references to its left and right tree node siblings. This implementation has recursive as well as iterative tree node insert methods.