Skip to main content

Simple implementation of data structures for python

Project description

fds

Simple implementaion of data structures (DS) for python

Content

  • linked list
  • stack
  • queue

Classes

  • List // linked list
  • Stack // stack
  • Queue // queue

API

List

  • insert(self, data, pos=0) // TODO: add node in the entered position (pos=0 => add in the begining)
  • append(self, data) // TODO: add node in the end
  • delete(self, data) // TODO: delete all nodes hav the entered data
  • remove(self, pos=0) // TODO: return and remove node in the entered position (pos=0 => remove first node, pos=-1 => remove last node)
  • first(self) // TODO: return the data in the first node
  • last(self) // TODO: return the data in the last node

Stack

  • push(self, data) // TODO: add a node to the top
  • pop(self) // TODO: return and remove the node in the top
  • top(self) // TODO: return the data in the first node

Queue

  • enqueue(self, data) // TODO: add a node to the end
  • dequeue(self) // TODO: return and remove the first element
  • front(self) // TODO: return the data in the first node
  • back(self) // TODO: return the data in the last node

API for all structures

  • repr(self) // USE: print([DS_name]) // TODO: display the DS
  • len(self) // USE: len([DS_name]) // TODO: return the lenth of the DS
  • empty(self) // TODO: return True if the DS is empty
  • clear(self) // TODO: clear the DS
  • find(self, data) // TODO: return the number of how many the entered data found in the DS
  • reverse(self) // TODO: return the reverse of the DS
  • merge(DS1, DS2) // USE: [DS] = [DS_type].merge([DS1], [DS2]) // TODO: return the merge of two DS (from the same type) in new DS (from the same type) // Example: stck3 = Stack.merge(stck1, stck2)

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

py-fds-1.2.2.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

py_fds-1.2.2-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file py-fds-1.2.2.tar.gz.

File metadata

  • Download URL: py-fds-1.2.2.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.3.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for py-fds-1.2.2.tar.gz
Algorithm Hash digest
SHA256 03eba608f58283fa9dbac064a9dcb341de8fe6bf90f1c439347613d78f149f8e
MD5 fa2e9747ffc10dddff4f222f94349092
BLAKE2b-256 44c15b514f4af3900de22808c91700afa90fd6a9e516a463b0b2c4cc9f0a28d8

See more details on using hashes here.

File details

Details for the file py_fds-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: py_fds-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.3.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for py_fds-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 52561a3469b3ca69932c0b88eaf26035fbea7e70be1202cb30d8c022dd204ba5
MD5 a230478837b242f3cb9b8393dd5c8b82
BLAKE2b-256 879479a256f315cf08a1672efc15423c94571039627ea5a35cebacf172850e16

See more details on using hashes here.

Supported by

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