-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Linked Lists #49
Comments
I have already written the code for Double LInked LIsts I am Currently Adding Single Linked Lists |
Please discuss the API first before moving on to a PR. Share your code here in the comments. |
API for Double Linked List:
API names can be changes easily in order to keep them parallel with norms please suggest any change in the names of the functions. I will share the temporary code in the next comment. Documentation is incomplete. Some examples with expected output has been provided at the end. |
What would be the amortized time complexity of this operation? |
I will comment on the code you shared just now a bit later. |
It would have to traverse through the string so the I cannot find any way to improve upon this without making extra arrays and increasing the memory consumed by the List. If you are aware of any methods please share any resources so I can add it. The operations at the ends take O(1) time though. Also should I change the I was facing difficulty uploading the .py file so I have uploaded the txt file with the code |
The code is fine but follow the coding style of the code in current master, especially the documentation. Please read the guidelines in the README file. The code should go in a new file under, |
Sorry for the sudden absence, due to my current location in Delhi, internet services were down due to some orders and I could not inform you before leaving for travelling. I have learned a bit about code coverage in the meantime and I will resume work on the single linked lists. |
I have read the feedback. I will make sure to follow them in any future PRs. |
Is it resolved? |
Only doubly linked lists are added as of writing this comment. |
Should there be a single The API for |
What about having, |
|
I thought LinkedList implementation of API for Should they be inherited from already defined |
The design of base class pydatastructs/pydatastructs/miscellaneous_data_structures/queue.py Lines 49 to 67 in 19cabb2
pydatastructs/pydatastructs/miscellaneous_data_structures/stack.py Lines 49 to 71 in 19cabb2
No, we don't need to inherit |
The |
Description of the problem
Currently the package does not have Queues or Linked Lists.
While working with issue #22-Add Queue
It was discovered that to add a Queue which is efficient enough to perform popleft() action in O(1) time we need linked lists to implement Queues just like the collections.deque implementaion of a Queue.
Since the original goal of issue #22 was to reduce dependencies on other libraries, LInked List must be added to pydatastructs to ensure an efficient implementation of Queues.
Example of the problem
References/Other comments
See the original issue -
#22
Read about the efficiency issue here -
https://www.geeksforgeeks.org/deque-in-python/
https://stackoverflow.com/questions/55578874/dequeue-complexity-on-using-python-list-as-a-queue
The text was updated successfully, but these errors were encountered: