# Linkify
`Linkify` is a Python library that converts arrays into linked lists. This library provides a simple way to create and manipulate linked lists using standard array data.
## Installation
You can install the `Linkify` library using pip:
```bash
pip install Linkify-Linkedlist
```
## Usage
- Creating a Linked List from an Array
```
from Linkify import LinkedList
# Create a linked list from an array
arr = [1, 2, 3, 4, 5]
linked_list = LinkedList.from_array(arr)
# Display the linked list with arrows
print(linked_list.display()) # Output: 1 -> 2 -> 3 -> 4 -> 5
```
- Appending Elements
```
from Linkify import LinkedList
# Create an empty linked list
linked_list = LinkedList()
# Append elements
linked_list.append(10)
linked_list.append(20)
# Display the linked list
print(linked_list.display()) # Output: 10 -> 20
```
- Use Case
Imagine you are developing a task management system where tasks are frequently added and removed. Using a linked list for storing these tasks can be more efficient compared to arrays, especially for operations that involve frequent insertions and deletions.
```
from Linkify import LinkedList
# Initial list of tasks
tasks = ['Task 1', 'Task 2', 'Task 3']
# Convert the list of tasks to a linked list
task_list = LinkedList.from_array(tasks)
# Add a new task
task_list.append('Task 4')
# Display the updated task list
print(task_list.display()) # Output: Task 1 -> Task 2 -> Task 3 -> Task 4
# Suppose Task 1 is completed, you can remove it from the list (implementation needed)
# task_list.remove('Task 1') # Assume you have implemented a remove method
# Display the list after removal
print(task_list.display()) # Output might be: Task 2 -> Task 3 -> Task 4
```
## License
This project is licensed under the MIT License - see the LICENSE file for details.
Raw data
{
"_id": null,
"home_page": "https://github.com/Shankhosuvro-G/linkify",
"name": "Linkify-Linkedlist",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Shankhosuvro Ghosh",
"author_email": "shankhosuvro.ghosh@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/88/c3/8f4b7ef984fb5a852181873bcff492363366c4d4f6ce3b2356c641abe46f/linkify_linkedlist-0.1.2.tar.gz",
"platform": null,
"description": "# Linkify\r\n\r\n`Linkify` is a Python library that converts arrays into linked lists. This library provides a simple way to create and manipulate linked lists using standard array data.\r\n\r\n## Installation\r\n\r\nYou can install the `Linkify` library using pip:\r\n\r\n```bash\r\npip install Linkify-Linkedlist\r\n```\r\n## Usage\r\n- Creating a Linked List from an Array\r\n\r\n```\r\nfrom Linkify import LinkedList\r\n\r\n# Create a linked list from an array\r\narr = [1, 2, 3, 4, 5]\r\nlinked_list = LinkedList.from_array(arr)\r\n\r\n# Display the linked list with arrows\r\nprint(linked_list.display()) # Output: 1 -> 2 -> 3 -> 4 -> 5\r\n```\r\n- Appending Elements\r\n\r\n```\r\nfrom Linkify import LinkedList\r\n\r\n# Create an empty linked list\r\nlinked_list = LinkedList()\r\n\r\n# Append elements\r\nlinked_list.append(10)\r\nlinked_list.append(20)\r\n\r\n# Display the linked list\r\nprint(linked_list.display()) # Output: 10 -> 20\r\n```\r\n- Use Case\r\n\r\nImagine you are developing a task management system where tasks are frequently added and removed. Using a linked list for storing these tasks can be more efficient compared to arrays, especially for operations that involve frequent insertions and deletions.\r\n\r\n```\r\nfrom Linkify import LinkedList\r\n\r\n# Initial list of tasks\r\ntasks = ['Task 1', 'Task 2', 'Task 3']\r\n\r\n# Convert the list of tasks to a linked list\r\ntask_list = LinkedList.from_array(tasks)\r\n\r\n# Add a new task\r\ntask_list.append('Task 4')\r\n\r\n# Display the updated task list\r\nprint(task_list.display()) # Output: Task 1 -> Task 2 -> Task 3 -> Task 4\r\n\r\n# Suppose Task 1 is completed, you can remove it from the list (implementation needed)\r\n# task_list.remove('Task 1') # Assume you have implemented a remove method\r\n\r\n# Display the list after removal\r\nprint(task_list.display()) # Output might be: Task 2 -> Task 3 -> Task 4\r\n```\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the LICENSE file for details.\r\n\r\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python library to convert arrays to linked lists",
"version": "0.1.2",
"project_urls": {
"Homepage": "https://github.com/Shankhosuvro-G/linkify"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "455a06be8e97114d327955660dcbc4086a8d5a3819a9ae762e4e04059cc9eccf",
"md5": "4c12bae7e9b5551931e20b775115fd46",
"sha256": "a78dc75cad9ad5de539a5d60a0d9f7b57f13e6bd092e915437e85fd3cb0a509d"
},
"downloads": -1,
"filename": "Linkify_Linkedlist-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4c12bae7e9b5551931e20b775115fd46",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 4093,
"upload_time": "2024-08-29T19:35:11",
"upload_time_iso_8601": "2024-08-29T19:35:11.233129Z",
"url": "https://files.pythonhosted.org/packages/45/5a/06be8e97114d327955660dcbc4086a8d5a3819a9ae762e4e04059cc9eccf/Linkify_Linkedlist-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "88c38f4b7ef984fb5a852181873bcff492363366c4d4f6ce3b2356c641abe46f",
"md5": "e7a28f43db6405d4fcf42ab60db5fa6c",
"sha256": "e5d7f7389b2393e6f74450822c80cb7ee399303cc809c7df8d159d1beb7523b7"
},
"downloads": -1,
"filename": "linkify_linkedlist-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "e7a28f43db6405d4fcf42ab60db5fa6c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 3405,
"upload_time": "2024-08-29T19:35:13",
"upload_time_iso_8601": "2024-08-29T19:35:13.105511Z",
"url": "https://files.pythonhosted.org/packages/88/c3/8f4b7ef984fb5a852181873bcff492363366c4d4f6ce3b2356c641abe46f/linkify_linkedlist-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-29 19:35:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Shankhosuvro-G",
"github_project": "linkify",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "linkify-linkedlist"
}