Skip to content
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

tests passing. functions descriptions/tests could be more clear. #11

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

felizj17
Copy link

@felizj17 felizj17 commented Jul 9, 2023

The term key is used several times in the test and readme but it was not clear if the key was the data stored in the node, or if it was the index of a node.

}
// - `size`
size(){
let curr = this.head

Choose a reason for hiding this comment

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

Can you think of a way to have this function run in O(1) instead of O(n)?

}
// - `containsDuplicates` check for duplicates - return true if contains duplicates, false if not
containsDuplicates(){
let curr = this.head

Choose a reason for hiding this comment

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

Using a set you could compare the length of the set to the length of the linked list for shorter, cleaner code

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