-
Notifications
You must be signed in to change notification settings - Fork 15
linked list #24
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
linked list #24
Conversation
yeoshuheng
commented
Jul 29, 2023
- Added README.md.
- Added test under test/dataStructures/linkedlist.
- Added more notes inside linkedlist implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, very comprehensive review of linked list. This is great! Hope you learnt more about it as well. Just some minor changes and restructuring to do. Perhaps the most valuable insight here is the point on why merge sort is used for linked list
However, arrays would be preferred if you already know the amount of elements you need to store ahead of time. | ||
It would also be preferred if you are conducting a lot of look up operations. | ||
|
||
## Linked List Variants |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do mention double-linked list too. This is the most common variant after the conventional linked list, that allows popping of elements from front and back. Java's Deque (double-ended queue i believe) is essentially a double-linkedlist
@@ -0,0 +1,100 @@ | |||
# Linked Lists |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great and comprehensive! Just some restructuring as per amadeus' suggestion on standardisation.
You can follow these headers, with some room for flexibility for sub-sections within each section.
# Title
Introduction or context or commonly misunderstood stuff. Stuff to tell the reader that we know the current context and all. so yup Linked List vs Arrays is one good example.
## Analysis
Here we discuss time and space complexity of the whole algorithm. Perhaps if the algorithm has a non-trivial sub-routine, and its worth discussing more, than you can discuss how the analysis is derived here. No need to discuss implementation-specific unless necessary (though in-line comment in the code itself might better help), grab the general idea and present.
## Notes / Further Details / Conclusion
Here is an optional section to discuss further misc details that do not fit above but you believe to be crucial for students to be aware of. I think your addition of variants is one good example! You discussion on memory requirements, with linked list being a versatile structure that does not require a fixed size to be declared can put here too.
I noticed you discussed search and insert operations. I think these are not necessary and we probably should avoid making it a standard else its more workload. Only operations that are non-trivial (not easily inferred from code) should then be considered for discussion here. For linked list, i think its fine to omit since most students should be able to easily parse the logic from the code.
One last thing, for each of the ## sections, you can do what you did of segregating further into ### sub-sections if you wish.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM