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

Time - Haben #35

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Time - Haben #35

wants to merge 7 commits into from

Conversation

HabenFoto
Copy link

I wasn't sure if the reverse one was optional. After trying it, I decided to skip the test as I didn't want to waste more time at the last minute.

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.

Overall well done, but you submitted the TREE assignment instead of this one. When you get it turned in, I'll change the mark.

Take a look at my comments and let me know what questions you have.

Comment on lines +25 to +27
# 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.

👍

# Space Complexity: ?
def find_min
raise NotImplementedError
while (current = current.next)

Choose a reason for hiding this comment

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

Clever use of the = sign here.

Comment on lines +38 to +40
# Time Complexity: O(n)
# Space Complexity: O(n)
def search(value)

Choose a reason for hiding this comment

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

👍 , the space complexity is O(1)

Comment on lines +69 to +71
# 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.

👍 , the space complexity is O(1) because you're not creating a new list.

Comment on lines +83 to +85
# Time Complexity: O(n)
# Space Complexity: O(n)
def length

Choose a reason for hiding this comment

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

👍 , the space complexity is O(1) because you're not creating a new list.

Comment on lines +126 to +128
# Time Complexity: O(n)
# Space Complexity: O(n)
def delete(value)

Choose a reason for hiding this comment

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

👍 , the space complexity is O(1) because you're not creating a new list.

Comment on lines +148 to +163
# Time Complexity: o(n)
# Space Complexity: O(n)
# def reverse
# current = @head
# while current != nil
# temp = current.previous
# current.previous = current.next
# current.next = temp
# current = current.previous
# end
# temp = @head
# @head = @tail
# @tail = temp
# end

def reverse

Choose a reason for hiding this comment

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

👍 , the space complexity is O(1) because you're not creating a new list.

Comment on lines +216 to +218
# Time Complexity: ?
# Space Complexity: ?
def get_first

Choose a reason for hiding this comment

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

👍 , space & time complexity?

Comment on lines +223 to +225
# Time Complexity: O(n)
# Space Complexity: O(n)
def add_last(value)

Choose a reason for hiding this comment

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

👍 , Space complexity is O(1)

Comment on lines +239 to +241
# Time Complexity: O(n)
# Space Complexity: O(n)
def get_last

Choose a reason for hiding this comment

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

👍 , the space complexity is O(1) because you're not creating a new list.

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