Skip to content

Conversation

yeoshuheng
Copy link
Collaborator

  • Added README.md.
  • Added test under test/dataStructures/linkedlist.
  • Added more notes inside linkedlist implementation.

Copy link
Owner

@4ndrelim 4ndrelim left a 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
Copy link
Owner

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
Copy link
Owner

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.

Copy link
Owner

@4ndrelim 4ndrelim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@4ndrelim 4ndrelim merged commit c0676c1 into 4ndrelim:main Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants