All Projects → chdemko → php-sorted-collections

chdemko / php-sorted-collections

Licence: BSD-3-Clause license
Sorted Collections for PHP

Programming Languages

PHP
23972 projects - #3 most used programming language
TeX
3793 projects

Projects that are alternatives of or similar to php-sorted-collections

Gods
GoDS (Go Data Structures). Containers (Sets, Lists, Stacks, Maps, Trees), Sets (HashSet, TreeSet, LinkedHashSet), Lists (ArrayList, SinglyLinkedList, DoublyLinkedList), Stacks (LinkedListStack, ArrayStack), Maps (HashMap, TreeMap, HashBidiMap, TreeBidiMap, LinkedHashMap), Trees (RedBlackTree, AVLTree, BTree, BinaryHeap), Comparators, Iterators, …
Stars: ✭ 10,883 (+49368.18%)
Mutual labels:  map, set, tree, iterator
Buckets Js
A complete, fully tested and documented data structure library written in pure JavaScript.
Stars: ✭ 1,128 (+5027.27%)
Mutual labels:  map, set, tree, collection
Containers
This library provides various containers. Each container has utility functions to manipulate the data it holds. This is an abstraction as to not have to manually manage and reallocate memory.
Stars: ✭ 125 (+468.18%)
Mutual labels:  map, set, tree, collection
Collection
A PHP library for representing and manipulating collections.
Stars: ✭ 488 (+2118.18%)
Mutual labels:  map, set, collection
Kind Of
Get the native JavaScript type of a value, fast. Used by superstruct, micromatch and many others!
Stars: ✭ 268 (+1118.18%)
Mutual labels:  map, set, iterator
Libdict
C library of key-value data structures.
Stars: ✭ 234 (+963.64%)
Mutual labels:  map, tree, iterator
ctl
My variant of the C Template Library
Stars: ✭ 105 (+377.27%)
Mutual labels:  set, tree, iterator
NonEmptyCollections
A type-safe implementation for collections that cannot be empty. Life is too short for emptiness-checks!
Stars: ✭ 45 (+104.55%)
Mutual labels:  map, set, collection
Php Enum
Simple and fast implementation of enumerations with native PHP
Stars: ✭ 446 (+1927.27%)
Mutual labels:  map, set
js-collections-map-set
Repository to have example code to demonstrate JavaScript Map and Set data structures.
Stars: ✭ 21 (-4.55%)
Mutual labels:  map, set
Exploretrees Sg
🌳 Explore Trees in Singapore 🇸🇬
Stars: ✭ 68 (+209.09%)
Mutual labels:  map, tree
Redisson
Redisson - Redis Java client with features of In-Memory Data Grid. Over 50 Redis based Java objects and services: Set, Multimap, SortedSet, Map, List, Queue, Deque, Semaphore, Lock, AtomicLong, Map Reduce, Publish / Subscribe, Bloom filter, Spring Cache, Tomcat, Scheduler, JCache API, Hibernate, MyBatis, RPC, local cache ...
Stars: ✭ 17,972 (+81590.91%)
Mutual labels:  map, set
observable ish
Observable state and events for browser and Flutter.
Stars: ✭ 26 (+18.18%)
Mutual labels:  map, set
Map
PHP Map package for easy and elegant handling of PHP arrays as array-like map objects
Stars: ✭ 1,180 (+5263.64%)
Mutual labels:  map, collection
Awesome Maps
There is more than google: A collection of great online maps 🌍🗺🌎
Stars: ✭ 124 (+463.64%)
Mutual labels:  map, collection
Hamt
Immutable and Memory-Efficient Maps and Sets in Go
Stars: ✭ 213 (+868.18%)
Mutual labels:  map, set
Collectable
High-performance immutable data structures for modern JavaScript and TypeScript applications. Functional interfaces, deep/composite operations API, mixed mutability API, TypeScript definitions, ES2015 module exports.
Stars: ✭ 233 (+959.09%)
Mutual labels:  map, set
AhaAlgorithms
《啊哈算法》书上代码
Stars: ✭ 47 (+113.64%)
Mutual labels:  map, tree
Redux Data Structures
Reducer factory functions for common data structures: counters, maps, lists (queues, stacks), sets, etc.
Stars: ✭ 157 (+613.64%)
Mutual labels:  map, set
avl array
High performance templated AVL tree using a fixed size array. Extensive test suite passing.
Stars: ✭ 33 (+50%)
Mutual labels:  tree, avl

PHP Sorted Collections

Flattr this git repo Travis Documentation Status Coveralls Scrutinizer PHP versions Latest Stable Version Packagist Latest Unstable Version License

Sorted Collection for PHP. Insertion, search, and removal compute in log(n) time where n is the number of items present in the collection. It uses AVL threaded tree [see @Knuth97, 1:320, Sect. 2.3.1] as internal structure.

@Knuth97: Donald E. Knuth, The Art of Computer Programming, Addison-Wesley, volumes 1 and 2, 2nd edition, 1997.

This project uses:

Instructions

Using composer: either

$ composer create-project chdemko/sorted-collections:1.0.*@dev; cd sorted-collections

or create a composer.json file containing

{
    "require": {
        "chdemko/sorted-collections": "1.0.*@dev"
    }
}

and run

$ composer install

Run also

$ [sudo] pip install [--user] -r docs/requirements.txt

if you want to create local documentation.

Create a test.php file containg

require __DIR__ . '/vendor/autoload.php';

use chdemko\SortedCollection\TreeMap;

$tree = TreeMap::create()->put(
    [1=>1, 9=>9, 5=>5, 2=>2, 6=>6, 3=>3, 0=>0, 8=>8, 7=>7, 4=>4]
);
echo $tree . PHP_EOL;

This should print

[0,1,2,3,4,5,6,7,8,9]

See the examples and benchmarks folder for more information.

Citation

If you are using this project including publication in research activities, you have to cite it using (BibTeX format). You are also pleased to send me an email to [email protected].

All releases can be found here

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].