PHPackages                             diogoca/dsalgorithms - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. diogoca/dsalgorithms

ActiveLibrary

diogoca/dsalgorithms
====================

Data Structures, Search, Sort, Numbers and String Algorithms

00PHPCI failing

Since Jul 7Pushed 5y agoCompare

[ Source](https://github.com/diogoca/DsAlgorithms)[ Packagist](https://packagist.org/packages/diogoca/dsalgorithms)[ RSS](/packages/diogoca-dsalgorithms/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Data structures and Algorithms
==============================

[](#data-structures-and-algorithms)

Data Structures and Search, Sort, Numbers, String Algorithms implemented using PHP, the goal of this project it's the study and practice of them. Please let me know any mistake opening an issue.

- [Data Structures](https://github.com/diogoca/DsAlgorithms/tree/master/src/Ds)
- Algorithms
    - [Number](https://github.com/diogoca/DsAlgorithms/tree/master/src/Number)
    - [Search](https://github.com/diogoca/DsAlgorithms/tree/master/src/Search)
    - [Sort](https://github.com/diogoca/DsAlgorithms/tree/master/src/Sort)
    - [String](https://github.com/diogoca/DsAlgorithms/tree/master/src/String)

Installation
------------

[](#installation)

It's recommended that you use [Composer](https://getcomposer.org/) to install.

```
$ composer require diogoca/dsalgorithms
```

Using
-----

[](#using)

### ArrayList

[](#arraylist)

```
$list = new \DsAlgorithms\Ds\DsList\ArrayList();
$list->add('foo');
$list->add('bar');
$list->add('x');
$list->add('y');
$list->add('z');

echo $list . PHP_EOL; # [foo, bar, x, y, z]
echo $list->get(1) . PHP_EOL; # bar
$list->remove(2);
echo $list . PHP_EOL; # [foo, bar, y, z]
```

### Search

[](#search)

Comparing what algorithm do less calls.

```
use DsAlgorithms\Search\BinarySearch;
use DsAlgorithms\Search\SequentialSearch;

$arr = \range(7, 14);
$arrCopy = $arr;

print_r($arr);

echo '14 in index ' . BinarySearch::search($arr, 14) . PHP_EOL;
echo 'binary search calls ' . BinarySearch::$calls . PHP_EOL;

echo '14 in index ' . SequentialSearch::search($arr, 14) . PHP_EOL;
echo 'sequencial search calls ' . SequentialSearch::$calls . PHP_EOL;
```

Running from bash
-----------------

[](#running-from-bash)

```
$ php public/index.php src/String/MaximumOccurringCharacter.php
```

Notes
-----

[](#notes)

- On DsAlgorithms\\Ds\\DsList namespace I'm not using List as name once that's a PHP reserved word
- I'm using \\SplFixedArray once that on PHP I can't create an array with fixed size

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/757877e43c2592bdd428a9882ccbe6bd5d7cc76154bb0dbcedb8b8161221a66f?d=identicon)[diogoca](/maintainers/diogoca)

---

Top Contributors

[![diogoca](https://avatars.githubusercontent.com/u/692065?v=4)](https://github.com/diogoca "diogoca (3 commits)")

---

Tags

algorithmsdata-structuresphp

### Embed Badge

![Health badge](/badges/diogoca-dsalgorithms/health.svg)

```
[![Health](https://phpackages.com/badges/diogoca-dsalgorithms/health.svg)](https://phpackages.com/packages/diogoca-dsalgorithms)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
