# pyfds
Simple implementation of data structures __(DS)__ for python.
This package no more supported and will not get new updates, see [PyAlStruct](https://pypi.org/project/PyAlStruct/) for new implementation of algorithms and data structures.
## Content of the library
- linked list
- doubly linked list
- sorted linked list
- stack
- queue
- priority queue
- binary search tree
* __utils__ // (package)
### Content of utils
- node // single pointer node
- dnode // double pointer node
- tnode // tree pointer node
- pair
### how to import utils
`from pyfds.utils import *`\
`pair = Pair()`\
or\
`import pyfds.utils`\
`pair = utils.Pair()`
## Classes
- List // linked list
- DList // doubly linked list
- SList // sorted linked list
- Stack // stack
- Queue // queue
- PQueue // priority queue
- BST // binary search tree
## API
<details><summary>List</summary>
<details><summary>Properties</summary>
- first // TODO: return the data in the first node
- last // TODO: return the data in the last node
</details>
<details><summary>Methodes</summary>
- insert(data, pos) // TODO: add node in the entered position (pos=0 => add in the begining) // the default value is set to 0
- append(data) // TODO: add node in the end
- delete(data) // TODO: delete all nodes hav the entered data
- remove(pos=0) // TODO: return and remove node in the entered position (pos=0 => remove first node, pos=-1 => remove last node)
</details>
</details>
<details><summary>DList</summary>
<details><summary>Properties</summary>
- first // TODO: return the data in the first node
- last // TODO: return the data in the last node
</details>
<details><summary>Methodes</summary>
- add_begin(data) // TODO: add a node to the begin
- add_fin(data) // TODO: add a node to the fin
- delete(data) // TODO: delete all nodes hav the entered data
- remove(pos) // TODO: return and remove node in the entered position (pos=0 => remove first node, pos=-1 => remove last node) // the default value is set to 0
</details>
</details>
<details><summary>SList</summary>
<details><summary>Properties</summary>
- first // TODO: return the data in the first node
- last // TODO: return the data in the last node
</details>
<details><summary>Methodes</summary>
- append(data) // TODO: add a node to the list in a sorted way
- delete(data) // TODO: delete all nodes hav the entered data
- remove(pos) // TODO: return and remove node in the entered position (pos=0 => remove first node, pos=-1 => remove last node) // the default value is set to 0
</details>
</details>
<details><summary>Stack</summary>
<details><summary>Properties</summary>
- top // TODO: return the data in the first node
</details>
<details><summary>Methodes</summary>
- push(data) // TODO: add a node to the top
- pop() // TODO: return and remove the node in the top
</details>
</details>
<details><summary>Queue</summary>
<details><summary>Properties</summary>
- front // TODO: return the data in the first node
- back // TODO: return the data in the last node
</details>
<details><summary>Methods</summary>
- enqueue(data) // TODO: add a node to the end
- dequeue() // TODO: return and remove the first element
</details>
</details>
<details><summary>PQueue</summary>
<details><summary>Properties</summary>
- front // TODO: return the data in the first node
- back // TODO: return the data in the last node
</details>
<details><summary>Methods</summary>
- enqueue(data) // TODO: add a node to the queue in a sorted way
- dequeue() // TODO: return and remove the first element
</details>
</details>
<details><summary>methods for all DSs</summary>
- __str__() // USE: print([DS_name]) // TODO: display the __DS__
- __len__() // USE: len([DS_name]) // TODO: return the lenth of the __DS__
- empty() // TODO: return True if the __DS__ is empty
- clear() // TODO: clear the __DS__
- find(data) // TODO: return the number of how many the entered data found in the __DS__
- reverse() // TODO: return the reverse of the __DS__
- sort() // TODO: sort the __DS__ if its not sorted
- exchange(n) // TODO: circular permutation for n time
- equals(DS) // TODO: return True if `DS` is equal to __this DS__
</details>
<details><summary>classmethods for all DSs</summary>
// USE: [DS] = [DS_type].method([DS1], [DS2])<br>
// Examples:<br>
`stck3 = Stack.merge(stck1, stck2)`<br>
`Stack.swap([DS1], [DS2])`<br>
__the tow DS parameters must be from the same DS__
- merge(DS1, DS2) // TODO: return the merge of two __DSs__ in new __DS__
- swap(DS1, DS2) // TODO: swap between DS1 and DS2 (`DS1` will be `DS2` and `DS2` will be `DS1`)
</details>
#### Note :
(reverse, sort, exchange) are not supported in this __DS__ because they brake the rule of the __Sorted Linked List__
<details><summary>BST</summary>
<details><summary>properties</summary>
- number_of_nodes // TODO: return the number of nodes in the __BST__
- number_of_liefs // TODO: return the number of liefs (nodes without any children) in the __BST__
- height // TODO: return the height of the __BST__
- max // TODO: return the maximum value in the __BST__
- min // TODO: return the minimum value in the __BST__
</details>
<details><summary>methodes</summary>
- pre_order() // TODO: represent the __BST__ in pre_order way
- in_order() // TODO: represent the __BST__ in in_order way
- post_order() // TODO: represent the __BST__ in post_order way
- append(data) // TODO: append a new node to the __BST__ if not exist
- find(data) // TODO: search for an element in the __BST__ and return it if exist
- parent(data) // TODO: return the parent node of an element if exist
- successor(data) // TODO: return the next value in the __BST__ if exist
- predecessor(data) // TODO: return the previous value in the __BST__ if exist
- delete(data) // TODO: delete an element from the __BST__ if exist
- equals(bst) // TODO: return True if `bst` is equal to __this BST__ (__this BST__ is the same as `bst`)
</details>
</details>
Raw data
{
"_id": null,
"home_page": "https://github.com/FathiMalek/py-fds.git",
"name": "py-fds",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Abdelmalek Fathi",
"author_email": "abdelmalek.fathi.2001@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/b5/7d/819b5ed8841fcb4c6fa69e3baf731e82bbf6df32572e112648ca18b21a7e/py-fds-3.5.3.tar.gz",
"platform": null,
"description": "# pyfds\n\nSimple implementation of data structures __(DS)__ for python.\n\nThis package no more supported and will not get new updates, see [PyAlStruct](https://pypi.org/project/PyAlStruct/) for new implementation of algorithms and data structures.\n\n## Content of the library\n\n- linked list\n- doubly linked list\n- sorted linked list\n- stack\n- queue\n- priority queue\n- binary search tree\n* __utils__ // (package)\n\n### Content of utils\n\n- node // single pointer node\n- dnode // double pointer node\n- tnode // tree pointer node\n- pair\n\n### how to import utils\n\n`from pyfds.utils import *`\\\n`pair = Pair()`\\\nor\\\n`import pyfds.utils`\\\n`pair = utils.Pair()`\n\n## Classes\n\n- List // linked list\n- DList // doubly linked list\n- SList // sorted linked list\n- Stack // stack\n- Queue // queue\n- PQueue // priority queue\n- BST // binary search tree\n\n## API\n\n<details><summary>List</summary>\n\n<details><summary>Properties</summary>\n\n- first // TODO: return the data in the first node\n- last // TODO: return the data in the last node\n\n</details>\n<details><summary>Methodes</summary>\n\n- insert(data, pos) // TODO: add node in the entered position (pos=0 => add in the begining) // the default value is set to 0\n- append(data) // TODO: add node in the end\n- delete(data) // TODO: delete all nodes hav the entered data\n- remove(pos=0) // TODO: return and remove node in the entered position (pos=0 => remove first node, pos=-1 => remove last node)\n\n</details>\n</details>\n<details><summary>DList</summary>\n\n<details><summary>Properties</summary>\n\n- first // TODO: return the data in the first node\n- last // TODO: return the data in the last node\n\n</details>\n<details><summary>Methodes</summary>\n\n- add_begin(data) // TODO: add a node to the begin\n- add_fin(data) // TODO: add a node to the fin\n- delete(data) // TODO: delete all nodes hav the entered data\n- remove(pos) // TODO: return and remove node in the entered position (pos=0 => remove first node, pos=-1 => remove last node) // the default value is set to 0\n\n</details>\n</details>\n<details><summary>SList</summary>\n\n<details><summary>Properties</summary>\n\n- first // TODO: return the data in the first node\n- last // TODO: return the data in the last node\n\n</details>\n<details><summary>Methodes</summary>\n\n- append(data) // TODO: add a node to the list in a sorted way\n- delete(data) // TODO: delete all nodes hav the entered data\n- remove(pos) // TODO: return and remove node in the entered position (pos=0 => remove first node, pos=-1 => remove last node) // the default value is set to 0\n\n</details>\n</details>\n<details><summary>Stack</summary>\n\n<details><summary>Properties</summary>\n\n- top // TODO: return the data in the first node\n\n</details>\n<details><summary>Methodes</summary>\n\n- push(data) // TODO: add a node to the top\n- pop() // TODO: return and remove the node in the top\n\n</details>\n</details>\n<details><summary>Queue</summary>\n\n<details><summary>Properties</summary>\n\n- front // TODO: return the data in the first node\n- back // TODO: return the data in the last node\n\n</details>\n<details><summary>Methods</summary>\n\n- enqueue(data) // TODO: add a node to the end\n- dequeue() // TODO: return and remove the first element\n\n</details>\n</details>\n<details><summary>PQueue</summary>\n\n<details><summary>Properties</summary>\n\n- front // TODO: return the data in the first node\n- back // TODO: return the data in the last node\n\n</details>\n<details><summary>Methods</summary>\n\n- enqueue(data) // TODO: add a node to the queue in a sorted way\n- dequeue() // TODO: return and remove the first element\n\n</details>\n</details>\n<details><summary>methods for all DSs</summary>\n\n- __str__() // USE: print([DS_name]) // TODO: display the __DS__\n- __len__() // USE: len([DS_name]) // TODO: return the lenth of the __DS__\n- empty() // TODO: return True if the __DS__ is empty\n- clear() // TODO: clear the __DS__\n- find(data) // TODO: return the number of how many the entered data found in the __DS__\n- reverse() // TODO: return the reverse of the __DS__\n- sort() // TODO: sort the __DS__ if its not sorted\n- exchange(n) // TODO: circular permutation for n time\n- equals(DS) // TODO: return True if `DS` is equal to __this DS__\n\n</details>\n<details><summary>classmethods for all DSs</summary>\n\n// USE: [DS] = [DS_type].method([DS1], [DS2])<br>\n// Examples:<br>\n`stck3 = Stack.merge(stck1, stck2)`<br>\n`Stack.swap([DS1], [DS2])`<br>\n__the tow DS parameters must be from the same DS__\n- merge(DS1, DS2) // TODO: return the merge of two __DSs__ in new __DS__\n- swap(DS1, DS2) // TODO: swap between DS1 and DS2 (`DS1` will be `DS2` and `DS2` will be `DS1`)\n\n</details>\n\n#### Note :\n(reverse, sort, exchange) are not supported in this __DS__ because they brake the rule of the __Sorted Linked List__\n\n<details><summary>BST</summary>\n\n<details><summary>properties</summary>\n\n- number_of_nodes // TODO: return the number of nodes in the __BST__\n- number_of_liefs // TODO: return the number of liefs (nodes without any children) in the __BST__\n- height // TODO: return the height of the __BST__\n- max // TODO: return the maximum value in the __BST__\n- min // TODO: return the minimum value in the __BST__\n\n</details>\n<details><summary>methodes</summary>\n\n- pre_order() // TODO: represent the __BST__ in pre_order way\n- in_order() // TODO: represent the __BST__ in in_order way\n- post_order() // TODO: represent the __BST__ in post_order way\n- append(data) // TODO: append a new node to the __BST__ if not exist\n- find(data) // TODO: search for an element in the __BST__ and return it if exist \n- parent(data) // TODO: return the parent node of an element if exist\n- successor(data) // TODO: return the next value in the __BST__ if exist\n- predecessor(data) // TODO: return the previous value in the __BST__ if exist\n- delete(data) // TODO: delete an element from the __BST__ if exist\n- equals(bst) // TODO: return True if `bst` is equal to __this BST__ (__this BST__ is the same as `bst`)\n\n</details>\n</details>\n",
"bugtrack_url": null,
"license": "",
"summary": "Simple implementation of data structures for python",
"version": "3.5.3",
"project_urls": {
"Homepage": "https://github.com/FathiMalek/py-fds.git"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "356b9f67e8f17772e01981590db13d35567ebe6bccf4e62e81472ae6b7f15194",
"md5": "a1737438448687f4d6245ecff5670d79",
"sha256": "467e0b92912e6efe4ce4f23c29a44bd4827eeef0e41e54f8ce2c8b1a65e70a75"
},
"downloads": -1,
"filename": "py_fds-3.5.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a1737438448687f4d6245ecff5670d79",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 13104,
"upload_time": "2023-09-02T01:05:00",
"upload_time_iso_8601": "2023-09-02T01:05:00.604050Z",
"url": "https://files.pythonhosted.org/packages/35/6b/9f67e8f17772e01981590db13d35567ebe6bccf4e62e81472ae6b7f15194/py_fds-3.5.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b57d819b5ed8841fcb4c6fa69e3baf731e82bbf6df32572e112648ca18b21a7e",
"md5": "7d525b702cecd49e80dec8f3b5eff2e2",
"sha256": "0b757c4ad5ef19c143dae2a9943c63e5add2ec458d4a23aac5eeacbff899a051"
},
"downloads": -1,
"filename": "py-fds-3.5.3.tar.gz",
"has_sig": false,
"md5_digest": "7d525b702cecd49e80dec8f3b5eff2e2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8092,
"upload_time": "2023-09-02T01:05:03",
"upload_time_iso_8601": "2023-09-02T01:05:03.555459Z",
"url": "https://files.pythonhosted.org/packages/b5/7d/819b5ed8841fcb4c6fa69e3baf731e82bbf6df32572e112648ca18b21a7e/py-fds-3.5.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-02 01:05:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "FathiMalek",
"github_project": "py-fds",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "py-fds"
}