Skip to content

Conversation

@qqdipps
Copy link

@qqdipps qqdipps commented Aug 26, 2019

No description provided.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

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

Excellent work, you hit all the learning goals here! Well done! Check out my comments and let me know if you have any questions.

class LinkedList
def initialize
@head = nil # keep the head private. Not accessible outside this class
@tail = nil

Choose a reason for hiding this comment

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

Smart!


# method to return a string of all the values in the linked list
# Time Complexity: O(n) where n is the number of nodes
# Space Complexity: O(1)

Choose a reason for hiding this comment

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

Since you're building a string of equal size to the list, you have a space complexity of O(n)

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