Skip to content

Sockets - Grace#38

Open
gracemshea wants to merge 1 commit intoAda-C11:masterfrom
gracemshea:master
Open

Sockets - Grace#38
gracemshea wants to merge 1 commit intoAda-C11:masterfrom
gracemshea:master

Conversation

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

Thanks for the PR. Sorry I didn't notice it till now. The methods you have here look really good. Nice work!

Comment thread lib/linked_list.rb
# insert the new node at the beginning of the linked list
# Time Complexity: O(1), no need to traverse
# Space Complexity: O(1)
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.

👍

Comment thread lib/linked_list.rb
# returns true if found, false otherwise
# Time Complexity: O(n), we may need to traverse all nodes
# Space Complexity: O(1)
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.

👍

Comment thread lib/linked_list.rb
# returns the data value and not the node
# Time Complexity: O(n), we may need to traverse all nodes
# Space Complexity O(1)
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: O(n), we may need to traverse all nodes
# Space Complexity: O(1)
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
# method that returns the length of the singly linked list
# Time Complexity: O(n), we may need to traverse all nodes
# Space Complexity: O(1)
def length
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 nil if there are fewer nodes in the linked list than the index value
# Time Complexity: O(n), we may need to traverse all nodes
# Space Complexity: O(1)
def get_at_index(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.

👍

Comment thread lib/linked_list.rb
# method to print all the values in the linked list
# Time Complexity: O(n), we may need to traverse all nodes
# Space Complexity: O(1)
def visit
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
# method to delete the first node found with specified value
# Time Complexity: O(n), we may need to traverse all nodes
# Space Complexity O(1)
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
# note: the nodes should be moved and not just the values in the nodes
# Time Complexity: O(n), we may need to traverse all nodes
# Space Complexity: O(1)
def reverse
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍 Nice work!

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