Skip to content

Al Leonard - Linked List#48

Open
Alli-Oops wants to merge 2 commits intoAda-C15:masterfrom
Alli-Oops:master
Open

Al Leonard - Linked List#48
Alli-Oops wants to merge 2 commits intoAda-C15:masterfrom
Alli-Oops:master

Conversation

@Alli-Oops
Copy link
Copy Markdown

Thanks for looking at my Linked List answers!

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.

Al, overall nice work you hit the learning goals here, except you never tried working out the time/space complexity. I do suggest you try that as it's good practice.

Otherwise I only made some suggestions for drying up the code a bit. Let me know if you have questions.

Comment on lines +40 to +48
if current == None:
return False
while current:
if current.value == value:
return True
current = current.next
notTrue = True
if notTrue == True:
return False
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can be simplified

Suggested change
if current == None:
return False
while current:
if current.value == value:
return True
current = current.next
notTrue = True
if notTrue == True:
return False
if current == None:
return False
while current:
if current.value == value:
return True
current = current.next
return False

Comment on lines +65 to +66
if node_count:
return node_count
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
if node_count:
return node_count
return node_count

def __init__(self):
self.head = None # keep the head private. Not accessible outside this class
self.head = None # keep the head private. Not accessible outside this class
self.tail = None # keep track of the tail
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I notice you're not using this.

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