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

Sockets - Grace #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Sockets - Grace #38

wants to merge 1 commit into from

Conversation

gracemshea
Copy link

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.

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

# 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)

Choose a reason for hiding this comment

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

👍

# returns true if found, false otherwise
# Time Complexity: O(n), we may need to traverse all nodes
# Space Complexity: O(1)
def search(value)

Choose a reason for hiding this comment

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

👍

# 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

Choose a reason for hiding this comment

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

👍

# 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

Choose a reason for hiding this comment

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

👍

# 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

Choose a reason for hiding this comment

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

👍

# 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)

Choose a reason for hiding this comment

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

👍

# 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

Choose a reason for hiding this comment

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

👍

# 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)

Choose a reason for hiding this comment

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

👍

# 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

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