Skip to main content

In this package we simplifying the linked list concepts with useful functions

Project description

slinkedList

What is it?

slinkedList is a module to automate the operations that can be performed using linked list such as creating a new node, adding a new element,inserting an element at the head node, tail node and required location, merging the linked lists,sorting,duplicates removing and deleting the elements etc.

Where to get it

The source code is currently hosted on GitHub at: here

Installation

Use the package manager pip to install slinkedList.

Features

slinkedList can apply the following operations:

  • creating a single liked list with data
  • adding a node at starting,ending and particular position of the linked list
  • removing node at starting,ending and particular position of the linked list
  • Basic statistics like sum, min, max, mean, mode and median
  • converting the linked list data to string, list, tuple and set
  • counting the data occurrences in given linked list
  • sorting the linked list and assign the values in sorted way
  • Searching particular data items in liked list
  • Replacing the values with new data
  • Slicing the linked list
  • Removing duplicates, equalizing two liked lists, merging two linked list, copy, clear, push, pop, isempty, lenght etc etc..
  • The main advantage of this linked list is we can traverse using for loop and this linked list has operator overloading so we can perform +, -, *, **, /, //,%, [], +=,-= etc etc operations

Installation

slinkedList requires Python 3 .

To install using pip, use

pip install slinkedList

Usage

  • Import the library:
import slinkedList as ll
  • creating a empty linked list
empty_list= ll.SingleLinkedList() 
  • creating linked list with data
temp = ll.SingleLinkedList([1,2,3,4])
  • Some most commonly used operations
myList=ll.SingleLinkedList([1,2,3,4,5,6,7,8]) #creating ll with data
myList.addToEnd(12) #adds 12 to the ending

# printing Length
print(myList.length())

# printing indexes of given elements
print(myList.index([2,3,4]))

# printing elements at a particular indexes
print(myList.atIndex([3,1]))

# removing an element
print(myList.removeItem([12,1]))

# removing elements from a particular positions
myList.removeAtPosition([3,2,4])

#returns a list with descending order
new_list=myList.new_sorted(reverse=True)

Examples

1)

import slinkedList as ll

# creating LinkedList
m= ll.SingleLinkedList(data=[1,2,3,4])
n= ll.SingleLinkedList(data=[5,6,7])
o=m+n
print(o)

returns,

sllist([1, 2, 3, 4, 5, 6, 7])

2)

import slinkedList as ll
m= ll.SingleLinkedList(data=[1,2,3,4,5,6,7,8])
print(m[:4].toString("->"))

returns,

1->2->3->4

3)

import slinkedList as ll
m= ll.SingleLinkedList(data=[1,2,3,4])
print(reversed(m))

returns,

sllist([4, 3, 2, 1])

Documentation

The official documentation is hosted on Drive : doc

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

For any questions, issues, bugs, and suggestions please visit here

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

slinkedList-0.0.3.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

slinkedList-0.0.3-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file slinkedList-0.0.3.tar.gz.

File metadata

  • Download URL: slinkedList-0.0.3.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.8

File hashes

Hashes for slinkedList-0.0.3.tar.gz
Algorithm Hash digest
SHA256 0167a21ce08d1ace30783b9350f0e2ca65e1c4261f0b48a55eded9da8adfe5d5
MD5 e5abbf58a0d7d42797e8006f1abc3a4e
BLAKE2b-256 56a32d0d5dc7870346ff9a63216558d6a2666d9589d9dbc51cb8d2bd9ed670b9

See more details on using hashes here.

File details

Details for the file slinkedList-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: slinkedList-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.8

File hashes

Hashes for slinkedList-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 efaac749eb30a45c05a34b4c4dc0995f65afd26eac5e4fbdee7957a789c1f296
MD5 43525f0b2f61be85b2f61bc39ac5f82e
BLAKE2b-256 43a72e303b0fa97a4eb863a4b91e53e92bf2bfb390be44dc0f7f16f27da91b78

See more details on using hashes here.

Supported by

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