Skip to content

Sarah Jane Olivas - Spruce - C16#70

Open
sjolivas wants to merge 6 commits intoAda-C16:masterfrom
sjolivas:master
Open

Sarah Jane Olivas - Spruce - C16#70
sjolivas wants to merge 6 commits intoAda-C16:masterfrom
sjolivas:master

Conversation

@sjolivas
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@kyra-patton kyra-patton left a comment

Choose a reason for hiding this comment

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

✨ Nice work! Let me know what questions you have.

🟢

# Space Complexity: ?
# Time Complexity: O(1)
# Space Complexity: O(1)
def get_first(self):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

# Space Complexity: ?
# Time Complexity: O(1)
# Space Complexity: O(1)
def add_first(self, value):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

# Space Complexity: ?
# Time Complexity: O(n)
# Space Complexity: O(1)
def search(self, value):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

# Space Complexity: ?
# Time Complexity: O(n)
# Space Complexity: O(1)
def length(self):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

# Space Complexity: ?
# Time Complexity: O(n)
# Space Complexity: 0(1)
def get_at_index(self, index):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

# Space Complexity: ?
# Time Complexity: O(n)
# Space Complexity: O(1)
def add_last(self, value):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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


# method to return the max value in the linked list
# returns the data value and not the node
def find_max(self):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment on lines +157 to +158
if position.value == value:
break
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🤓 Generally, we like to avoid break statements where possible. How might you refactor your code to eliminate this one?

# Space Complexity: ?
# Time Complexity: O(n)
# Space Complexity: O(n)
def visit(self):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

# Space Complexity: ?
# Time Complexity: O(n)
# Space Complexity: O(1)
def reverse(self):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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