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-0.14-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

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))

C++

#include "SIDLL.h"

SIDLL s = SIDLL();
s.setVerborsity(0);

printf("Inserting...\n");
for (int i = 0; i < 1000; i += 1) {
    s.insertNode(i, i);
}

printf("Length:%d\n", s.getLength());
printf("maxKey:%f\n", s.toDouble(s.getMaxKey()));
printf("minKey:%f\n", s.toDouble(s.getMinKey()));
printf("Mean:%f\n", s.getMean());
printf("Median:%f\n\n", s.getMedian());

printf("Deleting...\n");
for (int i = 0; i < 950; i += 1) {
    s.deleteNode(i);
}

printf("Length:%d\n", s.getLength());
printf("maxKey:%f\n", s.toDouble(s.getMaxKey()));
printf("minKey:%f\n", s.toDouble(s.getMinKey()));
printf("Mean:%f\n", s.getMean());
printf("Median:%f\n", s.getMedian());

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

sidll-0.15-pp311-pypy311_pp73-win_amd64.whl (230.6 kB view details)

Uploaded PyPyWindows x86-64

sidll-0.15-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (125.2 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

sidll-0.15-pp310-pypy310_pp73-win_amd64.whl (229.9 kB view details)

Uploaded PyPyWindows x86-64

sidll-0.15-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (123.5 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

sidll-0.15-pp39-pypy39_pp73-win_amd64.whl (229.9 kB view details)

Uploaded PyPyWindows x86-64

sidll-0.15-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (123.4 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

sidll-0.15-pp38-pypy38_pp73-win_amd64.whl (229.9 kB view details)

Uploaded PyPyWindows x86-64

sidll-0.15-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (123.3 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

sidll-0.15-cp313-cp313-win_amd64.whl (232.3 kB view details)

Uploaded CPython 3.13Windows x86-64

sidll-0.15-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (123.6 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

sidll-0.15-cp312-cp312-win_amd64.whl (232.3 kB view details)

Uploaded CPython 3.12Windows x86-64

sidll-0.15-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (123.5 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

sidll-0.15-cp311-cp311-win_amd64.whl (231.8 kB view details)

Uploaded CPython 3.11Windows x86-64

sidll-0.15-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (125.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

sidll-0.15-cp310-cp310-win_amd64.whl (231.1 kB view details)

Uploaded CPython 3.10Windows x86-64

sidll-0.15-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (123.3 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

sidll-0.15-cp39-cp39-win_amd64.whl (230.3 kB view details)

Uploaded CPython 3.9Windows x86-64

sidll-0.15-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (123.5 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

sidll-0.15-cp38-cp38-win_amd64.whl (231.2 kB view details)

Uploaded CPython 3.8Windows x86-64

sidll-0.15-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (123.2 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

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

File metadata

File hashes

Hashes for sidll-0.15-pp311-pypy311_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 f5f84f228109fe915a4352fcce90c812873a54191a94f620f360cbd45580b69a
MD5 a913c85b4dfcb926d635aedf6e10c4da
BLAKE2b-256 da60c22c09ef5c6d5203814e922b038d4cad6c51a988df9c875e23b2e7c0cdab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sidll-0.15-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2854f9acc54f0e676aefc1c18d1e2aff6df509ef167c0b3d4de31716d900f275
MD5 a3fce2ee101737f6895089face871f9e
BLAKE2b-256 bc794b5ebed03c1a208593a6a82eeb0e646fb281202aca126fa139d2c53428e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sidll-0.15-pp310-pypy310_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 f259b8a79cfdda06709046cccbb41e9e4eae65b63d580011586dabc5589a7d2d
MD5 6a2eff182a4798f164a2ad576fb74e08
BLAKE2b-256 148667ebbfe6697aefd27690f141576013c33ed2a0f4f3d3e5991c1885237448

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sidll-0.15-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9aa99aa424c9d931a0670baabc7ed27f6eb94356da3c3625f61ddff6bd01c7a3
MD5 5d48e3d65d654f81227c6d35c07df507
BLAKE2b-256 7e9a7dbc81cb340939e280e40646a94c84b82a532c00ceb3265eea1fd1797bd6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sidll-0.15-pp39-pypy39_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 3158b72685fcf54bb28f5cf304ad5f22ffe17f10e8330ca8fcf006a96cde65a4
MD5 03b55f0c2e99f7177e03a1451908c32d
BLAKE2b-256 3a7d246c65b5b070e8ababc8b9264b909a2c9584230a497ff27abedf11a85ad6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sidll-0.15-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 81279cd5730e0bade90d93994d13372e635ecc0af553256f39bceb5698b8bc8c
MD5 89860d8bd7d8f2e7d23414f915ef81fe
BLAKE2b-256 6491626f2e845ffd6c1a7cd13b6fe198d4655f810291fd068443a106f194db37

See more details on using hashes here.

File details

Details for the file sidll-0.15-pp38-pypy38_pp73-win_amd64.whl.

File metadata

File hashes

Hashes for sidll-0.15-pp38-pypy38_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 6163f4b32bae685594e8e006e1a29b9d1acde834b2160c3c4cf84537ba0cc986
MD5 718df31fac0f5f6d670c9c5f79007bc0
BLAKE2b-256 e35b8e0f962e9ab6099586203c208b769f1a88e992b999ffa3b96da29b8771aa

See more details on using hashes here.

File details

Details for the file sidll-0.15-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sidll-0.15-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1cf30b42f24addecb35a754f0224a1c50543f117c711e0543f151ee049d45caa
MD5 0f551bcd43b2b8aa78a0014f08c4d3a3
BLAKE2b-256 a101b2cee9835b322bfdd6dc0f4039202f3955eab457b860807cf670330ffc13

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sidll-0.15-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 232.3 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.15-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 98dfb63e54ebfb93e2224eeead9f5c0deaee69eea675c4e7fbee723e990546ff
MD5 f5113c6010e9f940970989d1cbb4b007
BLAKE2b-256 861cb8b856e081f0861ff98cd5b52bc8b9286a80205515f82d562e8c65b67a11

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sidll-0.15-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 480387f35734b890a9ef88aea49cf319feb932ce6062abd2b1c4866931486986
MD5 9ec72718bab68ee333b285552cb407fd
BLAKE2b-256 6ec103cc3c58bf8f0a4723610bacd86aec24feb627fbaa4b90e7c929151c497e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sidll-0.15-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 232.3 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.15-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c260b3a32dc21140372bbb65fa3fad3daa55921e6de7a317477ea221db15660c
MD5 aed1f32d266090a3de3c46cc83c68805
BLAKE2b-256 d7f76019af5ff769c8ef4da7698c55951bc38e70371b4763c0113e98eae37842

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sidll-0.15-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b43ab21f013f4991c2311062ddff88efb43ee28020607211aa55fe306f122cb0
MD5 dc1027f216e408bda6cd0bce1dda29f0
BLAKE2b-256 7e1a12a0a987251be31e84aa8c34a22eb4480bee51b8771838c02a30916b9ab3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sidll-0.15-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 231.8 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.15-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 69d29d3fb0afd673bb307c69163799a9d9164430ade699ad65ea14c30d9a5e43
MD5 28677e504c2b0a42f2a3fb5740350047
BLAKE2b-256 f287c7f0d3b763790be60351984371957d705007bdadc4c684309c8865752875

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sidll-0.15-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 05dba3cdd743f191bd7b7b5782e335de5fa97c7d580e3b07d47f4a23d675b68b
MD5 ee6a47378dc920980c080dba94f5ce30
BLAKE2b-256 06325c4ba17c5e3af6476f7046d5f9f67e3fabab4c65ef40d410c3f88b7424e7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sidll-0.15-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 231.1 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.15-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 200ca6b7518e9b4d7630ca66f3f2bf9e9d22acf3b034e3cf19280014aa0a0bbf
MD5 51b8b4c71c67856af155dea06e173b5a
BLAKE2b-256 9525783004f659e2be87cbdabbf224e0d928057d3bb77a15eb08dfc759089a4b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sidll-0.15-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 78c587ca4d10b667920e02678ad6ba062738ba593a7817c9af5dae0abec85fa1
MD5 5a0401031dab551737d6f5770d60dcc2
BLAKE2b-256 44a290d62a7edb6824b3f772b3abe90a3a250e0b0113248df12a08a110f7b812

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sidll-0.15-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 230.3 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.15-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 d74e06fdb62f315b971d645491abc0a7fc63207f45730aff15e2dc5e67900ff6
MD5 361f7d6abc87a0df4ff100eb4c82dc14
BLAKE2b-256 d87fd8857717e36ec6ec5506650224260f330c58f044830430808b2e19aa450e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sidll-0.15-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3046e91ecbfed839d8b9eb809bc883f29be55957abeb3c7d8662b9a745c34076
MD5 df8253a4d1e277450c7a23afbd1a16ca
BLAKE2b-256 59b8711a23fb691a202804f8d10c552aea5fad41c19ad6b1485bc8de2bd9c93d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sidll-0.15-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 231.2 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.15-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 d5b93099a661e80da328360b0d3176a1d8e01b690768b5e41ceeeb833bc82c60
MD5 89c45b4cfbc0b2dccfd9d454827b001a
BLAKE2b-256 def63f2030b543025cc7c467cb4cf359f10c39266451dd388872fff311af898b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sidll-0.15-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 033771970537d172979046633d2a16c83a0f06c540dfb02cdcbb99105912561d
MD5 e03e5fe228ab51932ee8d0e204dcb754
BLAKE2b-256 0066afce53ccf309d8d3040c9bf84c08d4e5be3abdd7418faf655f98b0d90d40

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