Download the PHP package uniacid/sortedlinkedlist without Composer

On this page you can find all versions of the php package uniacid/sortedlinkedlist. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sortedlinkedlist

SortedLinkedList

A high-performance, type-safe, automatically-sorted linked list data structure for PHP with advanced features including binary search optimization, custom comparators, bulk operations, and immutable variants.

CI Status Coverage Status Latest Stable Version Total Downloads License PHP Version PHPStan PSR-12

Table of Contents

Features

Requirements

Installation

Quick Start

Usage Examples

Basic Operations with Different Types

Binary Search and Contains

Collection Operations

Bulk Operations

Array Access Interface

Iterator and Foreach

Converting to Array

Documentation

Performance Characteristics

Time Complexity

Operation SortedLinkedList Native Array (sorted) Notes
Add (single) O(n) O(n) List maintains sort order
Add (bulk) O(n*m) O(n+m) + O(n log n) m = items to add
Search (binary) O(log n) O(log n)* *Requires manual implementation
Search (contains) O(n) O(n) Linear search fallback
Remove O(n) O(n) Includes search time
Iteration O(n) O(n) Similar performance
Size O(1) O(1) Cached value
Clear O(1) O(1) Reset references

Memory Usage

Data Structure Memory Overhead Notes
SortedLinkedList ~2.5x Node objects + references
ImmutableSortedLinkedList ~1.5x per version Structural sharing reduces overhead
Native Array 1x (baseline) Contiguous memory

Benchmark Results

Performance benchmarks run on PHP 8.3 with 1000 elements:

Add Operations

Search Operations (Binary vs Linear)

Iterator Performance

Bulk Operations

When to Use SortedLinkedList

Use SortedLinkedList when:

Use Native Arrays when:

Advanced Usage

Custom Comparators

Immutable Operations

Performance Monitoring

Running Benchmarks

Testing

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. Make sure to:

  1. Add tests for new features
  2. Update benchmarks if performance-related
  3. Run composer check before submitting
  4. Follow PSR-12 coding standards

License

This project is licensed under the MIT License - see the LICENSE file for details.

Performance Optimization Tips

  1. Use Binary Search: For large datasets (>100 elements), always prefer binarySearch() over contains()
  2. Bulk Operations: Use addAll() instead of multiple add() calls for better performance
  3. Immutable Lists: Use for concurrent access or when you need to maintain multiple versions
  4. Custom Comparators: Implement efficient comparison logic to minimize operations
  5. Stats Monitoring: Use getStats() in development to identify performance bottlenecks

Roadmap


All versions of sortedlinkedlist with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package uniacid/sortedlinkedlist contains the following files

Loading the files please wait ...