Skip to content

Time - Emily#45

Open
snowistaken wants to merge 1 commit into
Ada-C13:masterfrom
snowistaken:master
Open

Time - Emily#45
snowistaken wants to merge 1 commit into
Ada-C13:masterfrom
snowistaken:master

Conversation

@snowistaken

Copy link
Copy Markdown

No description provided.

@CheezItMan CheezItMan left a comment

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 Emily, this all works although you're missing some time/space complexity. Well done.

Comment thread lib/linked_list.rb
Comment on lines +21 to 23
# Time Complexity: O(1)
# 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
Comment on lines +30 to 32
# Time Complexity: O(n)
# 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

# method to return the max value in the linked list
# returns the data value and not the node
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
Comment on lines +73 to 75
# Time Complexity: O(n)
# 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
Comment on lines +96 to 98
# Time Complexity: O(1)
# 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
Comment on lines +195 to 198
# Time Complexity: O(n)
# Space Complexity: O(1)
# unsure if this method actually works - did a brute force/pseudocode answer and didn't check because no tests
def find_middle_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
Comment on lines +210 to 212
# Time Complexity: O(n)
# Space Complexity: O(1)
def find_nth_from_end(n)

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
Comment on lines +243 to 245
# Time Complexity: O(1)
# Space Complexity: O(1)
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.

👍

Comment thread lib/linked_list.rb
Comment on lines +254 to 256
# Time Complexity: O(n)
# Space Complexity: O(1)
def add_last(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 nil if the linked list is empty
# Time Complexity: ?
# Space Complexity: ?
def get_last

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