<commit_before>Hack Fast Algos
==============

**STATUS:** IN DEVELOPMENT

Hack Fast Algos brings all of the most popular speed and space-efficient algorithms together in one library. The files
are completely written in Hack, so they'll work with your HHVM installation with Hack enabled.

Purpose
-------

Companies like Facebook, Google, and Microsoft rely on speed and space-efficient code to keep their websites and
projects running smoothly. You'll find that some of these algorithms are only either efficient on large data sets
(Ex. Lots of array elements) or require appropriate parameters for the task at hand. (Such as the configuration of
Quick Sort's parameters) I've commented on each algorithm's running times and storage requirements by using
asymptotic notation.

Keep in mind that HHVM is written primarily in C++ and C, and has a lot of built-in functionality that uses these
algorithms. (Ex. sort() uses an implementation of Quick Sort) Therefore, it's often faster to use the built in
functionality. However built in functions do not always give you the fine tuning capabilities required when working
with larger datasets.

This library also serves the purpose of aiding web developers in their conquest of learning algorithms and data
structures. If you intend to use the library as a learning or teaching tool, be advised that there are often multiple
ways to write the algorithm concepts. For instance, MergeSort does not need to run its recursion asynchronously, and
certain programming languages do not support asynchronous work-flows. The anthem of any good algorithm designer is,
"Can we make it better (faster/more memory efficient/more memory focused)?"

List of Algorithms
------------------

Every algorithm is grouped into a class of similar algorithms. Below is a list of classes, followed by the list of
algorithm methods in that class. For simplicity, the list below does not include the HackFastAlgos project namespace
of `HackFastAlgos.` So, if you wish to use `mergeSort` then you need to use
`\HackFastAlgos\Sort\mergeSort()`

**Algos**

**Graph**

**Math**

**Search**

**Select**

**Sort**

The callback function must operate the same way as the comparative function for
[usort](http://php.net/manual/en/function.usort.php). It allows for sorting arbitrary data in $vector.

`selectionSort<T>(Vector<T> $vector, Callable $callback) : Vector<T>`

`bubbleSort<T>(Vector<T> $vector, Callable $callback) : Vector<T>`

`insertSort<T>(Vector<T> $vector, Callable $callback) : Vector<T>`

`mergeSort<T>(Vector<T> $vector, Callable $callback, bool $returnWaitHandler = false) : T`

List of Data Structures
-----------------------

All data structures use the namespace `\HackFastAlgos\DataStructure`. Below is a list of data structure class
names and their methods. Data structures which employ a comparative function (`compare()`) may have said method
overridden to extend the capabilities of that data structure. All data used the generic type `T` for that reason.

**AVLTree**

**BPlusTree**

**BST**

BST is an implementation of a Binary Search Tree.

**BTree**

**DoublyLinkedList**

**GameTree**

**HashTable**

**Heap**

Heap supports both MinHeap and MaxHeap types.

**RBTree**

RBTree is an implementation of a Red-Black Tree.

**SplayTree**

**UnionFind**

The union-find data structure is also named the disjoint-set or merge-find. 
<commit_msg>Tagged 0.0.1<commit_after>Hack Fast Algos
==============

**STATUS:** IN DEVELOPMENT

Hack Fast Algos brings all of the most popular speed and space-efficient algorithms together in one library. The files
are completely written in Hack, so they'll work with your HHVM installation with Hack enabled.

Purpose
-------

Companies like Facebook, Google, and Microsoft rely on speed and space-efficient code to keep their websites and
projects running smoothly. You'll find that some of these algorithms are only either efficient on large data sets
(Ex. Lots of array elements) or require appropriate parameters for the task at hand. (Such as the configuration of
Quick Sort's parameters) I've commented on each algorithm's running times and storage requirements by using
asymptotic notation.

Keep in mind that HHVM is written primarily in C++ and C, and has a lot of built-in functionality that uses these
algorithms. (Ex. sort() uses an implementation of Quick Sort) Therefore, it's often faster to use the built in
functionality. However built in functions do not always give you the fine tuning capabilities required when working
with larger datasets.

This library also serves the purpose of aiding web developers in their conquest of learning algorithms and data
structures. If you intend to use the library as a learning or teaching tool, be advised that there are often multiple
ways to write the algorithm concepts. For instance, MergeSort does not need to run its recursion asynchronously, and
certain programming languages do not support asynchronous work-flows. The anthem of any good algorithm designer is,
"Can we make it better (faster/more memory efficient/more memory focused)?"

List of Algorithms
------------------

Every algorithm is grouped into a class of similar algorithms. Below is a list of classes, followed by the list of
algorithm methods in that class. For simplicity, the list below does not include the HackFastAlgos project namespace
of `HackFastAlgos.` So, if you wish to use `mergeSort` then you need to use
`\HackFastAlgos\Sort\mergeSort()`

**Algos**

**Graph**

**Math**

**Search**

**Select**

**Sort**

The callback function must operate the same way as the comparative function for
[usort](http://php.net/manual/en/function.usort.php). It allows for sorting arbitrary data in $vector.

`selectionSort<T>(Vector<T> $vector, Callable $callback) : Vector<T>`

`bubbleSort<T>(Vector<T> $vector, Callable $callback) : Vector<T>`

`insertSort<T>(Vector<T> $vector, Callable $callback) : Vector<T>`

`mergeSort<T>(Vector<T> $vector, Callable $callback, bool $returnWaitHandler = false) : T`

List of Data Structures
-----------------------

All data structures use the namespace `\HackFastAlgos\DataStructure`. Below is a list of data structure class
names and their methods. Data structures which employ a comparative function (`compare()`) may have said method
overridden to extend the capabilities of that data structure. All data used the generic type `T` for that reason.

**AVLTree**

**BPlusTree**

**BST**

BST is an implementation of a Binary Search Tree.

**BTree**

**DoublyLinkedList**

**GameTree**

**HashTable**

**Heap**

Heap supports both MinHeap and MaxHeap types.

**RBTree**

RBTree is an implementation of a Red-Black Tree.

**SplayTree**

**UnionFind**

The union-find data structure is also named the disjoint-set or merge-find.

{'fraction_non_alphanumeric': 0.08916445231768527, 'fraction_numerical': 0.0004428697962798937, 'mean_word_length': 4.585325638911789, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1386969', 'n_tokens_mistral': 1811, 'n_tokens_neox': 1737, 'n_words': 925}