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

Laneia #39

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

Laneia #39

wants to merge 1 commit into from

Conversation

laneia
Copy link

@laneia laneia commented Oct 8, 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.

Hey Laneia,

Nice work, thanks for the PR. In the future with later submissions, can you ping me so I notice. Overall very well done. Take a look at my comments and let me know if you have questions.

# insert the new node at the beginning of the linked list
# Time Complexity: O(1)
# 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)
# 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)
# 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.

👍

# method to return the min value in the linked list
# returns the data value and not the node
# Time Complexity: O(n)
# Space Complexity: O(n)

Choose a reason for hiding this comment

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

I think you meant space complexity O(1)

# returns the data value and not the node
# Time Complexity: O(n)
# Space Complexity: O(n)
def find_min

Choose a reason for hiding this comment

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

👍

# assume indexing starts at 0 while counting to n
# Time Complexity: O(n)
# Space Complexity: O(1)
def find_nth_from_end(n)

Choose a reason for hiding this comment

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

👍 Great work!

# returns true if a cycle is found, false otherwise.
# Time Complexity: O(n)
# Space Complexity: O(1)
def has_cycle

Choose a reason for hiding this comment

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

👍 Nice!

# method that inserts a given value as a new last node in the linked list
# Time Complexity: O(n)
# Space Complexity: O(1)
def add_last(value)

Choose a reason for hiding this comment

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

👍

# returns nil if the linked list is empty
# Time Complexity: O(n)
# Space Complexity: O(1)
def get_last

Choose a reason for hiding this comment

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

👍

# list is sorted in ascending order
# Time Complexity: O(n)
# Space Complexity: O(1)
def insert_ascending(value)

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