Skip to content

KS#40

Open
goblineer wants to merge 2 commits intoAda-C11:masterfrom
goblineer:master
Open

KS#40
goblineer wants to merge 2 commits intoAda-C11:masterfrom
goblineer:master

Conversation

@goblineer
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@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.

Hey Kate, thanks for the PR.

Most of the methods you have work great. If you find time to finish the rest ping me and I'll take a look at them. Please review my comments and let me know if you have questions or if I'm not making sense. One thing I'd like is to see you indicate the time & space complexity of each method.

Comment thread lib/linked_list.rb
@@ -21,39 +21,85 @@ def initialize
# Time Complexity:
# Space Complexity
def add_first(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.

👍
Time & Space Complexity?

Comment thread lib/linked_list.rb
# returns true if found, false otherwise
# Time Complexity:
# Space Complexity
def search(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.

👍
Time & Space Complexity?

Comment thread lib/linked_list.rb
# returns the data value and not the node
# Time Complexity:
# Space Complexity
def find_max
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 thread lib/linked_list.rb
# returns the data value and not the node
# Time Complexity:
# Space Complexity
def find_min
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 thread lib/linked_list.rb
current = @head

while current
i++
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

++ doesn't really work as an operator in Ruby. It treats this as i plus some positive number.

Suggested change
i++
i += 1

Comment thread lib/linked_list.rb
# method to delete the first node found with specified value
# Time Complexity:
# Space Complexity
def delete(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.

👍

Comment thread lib/linked_list.rb
@@ -120,7 +184,8 @@ def has_cycle
# Time Complexity:
# Space Complexity
def get_first
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