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

Linked List feedback #2

Open
lvreynoso opened this issue Nov 26, 2019 · 0 comments
Open

Linked List feedback #2

lvreynoso opened this issue Nov 26, 2019 · 0 comments

Comments

@lvreynoso
Copy link

lvreynoso commented Nov 26, 2019

Hi Ariane! I've graded your linked list submission and have some feedback for you:

  • good job passing all of the unit tests
  • a few issues with your time complexity analysis: your append() method actually runs in O(1) since you have a reference to the tail and are not looping through anything, and your delete() method has a best case of O(n) since you don't have any nested loops and if statements take constant time
  • it would be good practice to use elif statements in your delete() method when you have exclusive conditions. Your return statements avoid any errors, but keep in mind that an if statement written right after another if statement will always run, which can cause problems if the condition you're testing changes
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

No branches or pull requests

1 participant