Skip to main content

Sparse Indexed Doubly Linked List

Project description

Sparse Indexed Doubly Linked List (SIDLL)

Introduction

What is it?

A Sparse Indexed Doubly Linked List (SIDLL) is a linked list that is linked in both directions and which has indices (or pointers) distributed throughout the list which enables O(log p + k) worst case time complexity for inserts, deletes and lookups where p is the size of the indices/pointers and k is the maximum distance travelled between the pointer and a given node. Sparse distribution gives the user choice to trade-off between lookup times (faster if the interpointer distance is small) and memory (less if the interpointer distance is large).

What can it be used for?

Given that it is always sorted by key, it can be used to keep track of metrics like the streaming mean, median, head/tail as well as min/max (and their associated values).

Languages

Python, C++

Methods

  • insertNode(key,value)
  • deleteNode(key)
  • getMinKey()
  • getMaxKey()
  • getMean()
  • getMedian()
  • getLength()
  • head(length:optional)
  • tail(length:optional)
  • keyExists(key)
  • getValue(key,index:optional)
  • setInterpointerDistance(distance)

Installing

Python

There are installers for Windows and manylinux works with multiple Linux distros. For example, for Python 3.8 on CentOS:

pip install sidll

C++

The .h, .cpp files and CMakeLists.txt are in the SIDLL_C++ directory.

Example

Python

import sidll
import random

s = sidll.SIDLL()
s.setVerbosity(0)
s.setInterpointerDistance(10)
deleteList = []

print("-" * 25)
print("Inserting...")
for i in range(0,100):
    randKey = random.uniform(1,100000)
    randVal = random.uniform(1,100000)
    s.insertNode(randKey,0)
    deleteList.append(randKey)
    
print("Length:%d" %s.getLength())
print("MinKey:%f" %s.getMinKey())
print("MaxKey:%f" %s.getMaxKey())
print("Median:%f" %s.getMedian())
print("Mean:%f" %s.getMean())
print(s.head())
print(s.tail())

print("-" * 25)
print("Deleting...")
for i in range(0,50):
    if not deleteList:
        break
    keyToDelete = deleteList.pop()
    s.deleteNode(keyToDelete)
    
print("Length:%d" %s.getLength())
print("MinKey:%f" %s.getMinKey())
print("MaxKey:%f" %s.getMaxKey())
print("Median:%f" %s.getMedian())
print("Mean:%f" %s.getMean())
print(s.head())
print(s.tail())

print(dir(s))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sidll-0.16.tar.gz (12.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

sidll-0.16-pp311-pypy311_pp73-win_amd64.whl (233.1 kB view details)

Uploaded PyPyWindows x86-64

sidll-0.16-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (134.8 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

sidll-0.16-pp310-pypy310_pp73-win_amd64.whl (232.2 kB view details)

Uploaded PyPyWindows x86-64

sidll-0.16-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (133.0 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

sidll-0.16-pp39-pypy39_pp73-win_amd64.whl (232.4 kB view details)

Uploaded PyPyWindows x86-64

sidll-0.16-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (132.8 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

sidll-0.16-cp313-cp313-win_amd64.whl (235.4 kB view details)

Uploaded CPython 3.13Windows x86-64

sidll-0.16-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (135.3 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

sidll-0.16-cp312-cp312-win_amd64.whl (235.4 kB view details)

Uploaded CPython 3.12Windows x86-64

sidll-0.16-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (135.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

sidll-0.16-cp311-cp311-win_amd64.whl (234.4 kB view details)

Uploaded CPython 3.11Windows x86-64

sidll-0.16-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (134.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

sidll-0.16-cp310-cp310-win_amd64.whl (233.5 kB view details)

Uploaded CPython 3.10Windows x86-64

sidll-0.16-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (133.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

sidll-0.16-cp39-cp39-win_amd64.whl (232.6 kB view details)

Uploaded CPython 3.9Windows x86-64

sidll-0.16-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (133.4 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

sidll-0.16-cp38-cp38-win_amd64.whl (233.8 kB view details)

Uploaded CPython 3.8Windows x86-64

sidll-0.16-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (133.0 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

Details for the file sidll-0.16.tar.gz.

File metadata

  • Download URL: sidll-0.16.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.0

File hashes

Hashes for sidll-0.16.tar.gz
Algorithm Hash digest
SHA256 37d4431f78311535bb097cfd738b3ba1e97f9b7c61f9f6183f3d047adc97963c
MD5 9d0d40bd7100a325b86ca5f32ae3983f
BLAKE2b-256 270d6daecc413cdc960a33632d8f9177a3901da73c91340f284f0bfe8b501443

See more details on using hashes here.

File details

Details for the file sidll-0.16-pp311-pypy311_pp73-win_amd64.whl.

File metadata

File hashes

Hashes for sidll-0.16-pp311-pypy311_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 23f9abd48a5b94cd189f95f4bcd5710f28e7a0bbd5ad558c2851cc29632d3173
MD5 1b3bcd99466fe818db392982fc702885
BLAKE2b-256 510fa8cfbe399a1e840e493f7d6a2e43479b493cccfe4442ee31329fdd056ae7

See more details on using hashes here.

File details

Details for the file sidll-0.16-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sidll-0.16-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 61ecaf3e55b47eed9c325e6e56f85fee96faa7ad5d43b33b1e30fe7655f2815f
MD5 50f3e640ee065b4b96009c1ecf620192
BLAKE2b-256 188c3b9c93c27c32a22dcfecc66b7afcbcb7d5fd30b126f7f3e6774eb79d23d5

See more details on using hashes here.

File details

Details for the file sidll-0.16-pp310-pypy310_pp73-win_amd64.whl.

File metadata

File hashes

Hashes for sidll-0.16-pp310-pypy310_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 c19211b2bd72880ac54bb46dd923cf19956bbe86d27ca9b587106aa3c6ea59ad
MD5 cb78c6476245f45319ed2bedf9081963
BLAKE2b-256 c370721e9723d4c7975a32456c5d72f2d6dc5ab00b2e0a0263a06e7ccba537b3

See more details on using hashes here.

File details

Details for the file sidll-0.16-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sidll-0.16-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fcf7f97c17ac2822f8cdfcd02e36cf8502b1545bf583c76e7e6c0792a06058b4
MD5 6ef057d01b9cdcdbf5f2f563a2bf2ea2
BLAKE2b-256 d6ad4d38b147bf5f9a62d0416f7d02adfe4d848894a6099c8e950e086ad5238b

See more details on using hashes here.

File details

Details for the file sidll-0.16-pp39-pypy39_pp73-win_amd64.whl.

File metadata

File hashes

Hashes for sidll-0.16-pp39-pypy39_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 4020b28eb433fa2e7646db7741eba922ddac5e86a5a4a48028e81c5f19300e47
MD5 0c59e21638810506dda5567a4a08d362
BLAKE2b-256 6cdc070fa0744eee8a01693c078187dfb6dfdb37cc846956df8cbe8ba28a11e4

See more details on using hashes here.

File details

Details for the file sidll-0.16-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sidll-0.16-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 83893c970002d7a2fba95f2eae31b43bcbd8127f890acdd34a2ba71b33d39954
MD5 07c9c1e38980883a726d615d97ffe08f
BLAKE2b-256 f11f6e7a85c9f995d6831ab0e6bdbf5f8570434639a1c3beef9264a41c58d88c

See more details on using hashes here.

File details

Details for the file sidll-0.16-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: sidll-0.16-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 235.4 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.0

File hashes

Hashes for sidll-0.16-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9223e871ea950ce5d84b5da12135b921e1f031e9e0d585a4282d35c0d4196389
MD5 7c6c82c48700f9b506bf18d226f73c40
BLAKE2b-256 37a3013403f13c5eac2b4653e496936e516d2fec3ceca987fac4ec55009c8da3

See more details on using hashes here.

File details

Details for the file sidll-0.16-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sidll-0.16-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 250abd2188c1741015276d91c5f9ebb34f70b2eaf2fb97ea657720af3dafb5dc
MD5 1b4e8c74e63f0f7ccffe4d8187ea77d3
BLAKE2b-256 351a0b7d4340b72d0735850bca7090c5b82eeb54659304a70ccaf376384af711

See more details on using hashes here.

File details

Details for the file sidll-0.16-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: sidll-0.16-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 235.4 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.0

File hashes

Hashes for sidll-0.16-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 86f13b16980ef21580468f133a0c292650a4a0b6a36bfda393fc75c2c36bd461
MD5 ef34f0150dc0f550664c5060f51845fc
BLAKE2b-256 6f84387360d960f81ff535e2a80e35ab1dfc011298f17a477aea52f7d67f013a

See more details on using hashes here.

File details

Details for the file sidll-0.16-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sidll-0.16-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8a947c38343a7d773f56753ccdea5330c3544b3156cc9fca3c7ea6bf1c9c0070
MD5 9d7a00c770d7fa1d420421cb8afa84ef
BLAKE2b-256 6cf5d5eb1d48cef24a18bbe68c4accba02c97575c4f45ad02acb9f3ad2105c93

See more details on using hashes here.

File details

Details for the file sidll-0.16-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: sidll-0.16-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 234.4 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.0

File hashes

Hashes for sidll-0.16-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 65cbd3f8b425a97119514aa4feb91bbf3ae9060b67f86613241353b5330d6683
MD5 7b9cd2214321a1dee2bd6c3506bf5c6e
BLAKE2b-256 5c3a4eb357c4647947083256957890333cad1766aecf850148e1cef4e27534ea

See more details on using hashes here.

File details

Details for the file sidll-0.16-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sidll-0.16-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3ae4f162204d5083ed2030a82db72e6d806e457393b8d79f6229f9b84db7054b
MD5 781e7c4c441b77fc3db7df23099d4be0
BLAKE2b-256 b20b87d3056ddd87faade3981443a5653324be87a654b4bcd0cbe9bb1cd60c8f

See more details on using hashes here.

File details

Details for the file sidll-0.16-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: sidll-0.16-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 233.5 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.0

File hashes

Hashes for sidll-0.16-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ef1ff37c0ae8a7220df44bac45f4cc546106263ec9f2617e3fc0bb36cae1c726
MD5 08b6b32aad022e83584c01af3c40453a
BLAKE2b-256 10fd75c07ddca713751921147fe9f7af4c43b644e2db30d999ab732930311222

See more details on using hashes here.

File details

Details for the file sidll-0.16-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sidll-0.16-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1642bdc9027cd77bb154ad4a93541750ee9577b2eda0538607e735bbda039696
MD5 97f9337d2bc48efd02c4d968e8481cf6
BLAKE2b-256 bbe48dc5697da5b8c351e315d7c5dfbb7976527328539bf0d1608280f214472a

See more details on using hashes here.

File details

Details for the file sidll-0.16-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: sidll-0.16-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 232.6 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.0

File hashes

Hashes for sidll-0.16-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c33b2b66cc35d2100e6bfb5f720886a4fceb99d505815589d9abc0347232f515
MD5 28a525155b3c38c59b7114a01f60d545
BLAKE2b-256 e9da29bcdd2717b81027ded3ac4f8814ef20650d60632fcd0fc5d40da72d2e80

See more details on using hashes here.

File details

Details for the file sidll-0.16-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sidll-0.16-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 57c3b206b866abd4e241e79433b77bc405617fb73564bbe29d78b2e02dd3be87
MD5 7e62dac2151160d4eccb10cf7c9cd92f
BLAKE2b-256 63cda57ae48d43a83472b56c57f33046ff0b9833eb77abfa033f5e069b9505df

See more details on using hashes here.

File details

Details for the file sidll-0.16-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: sidll-0.16-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 233.8 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.0

File hashes

Hashes for sidll-0.16-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 6399c9419a37783d735ca33135d62e932837a0b3593e8c108332fb8ffea29510
MD5 d0178350e5b46471cd314101d5522388
BLAKE2b-256 1773da65a55b62ec3337a6d11b1d9e478c8ff234c0f50374797b372420042163

See more details on using hashes here.

File details

Details for the file sidll-0.16-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sidll-0.16-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2633b945c4dc11169ced32685132947ec6128e9aff9d4bbdfd9fb9af4ee40ed5
MD5 61faf2612229c5dd31ec95a8bf3f3720
BLAKE2b-256 107fd278f354cac2821ab1e866dc0f588c2aa568bbfdaeb0c1b6931bcf1d5d1a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page