Could someone please tell me why his code is considered 'non-pythonic'? This statement worries me a little, because his code looks pretty similar to what I write.
I only looked at the linked_list but there are a few examples that jump out straight away:
- Getters and setters are used all over the place (setData, getData etc)
- Strangely named variables - eg List = [] and newNode = Node(data)
- Non-pythonic conditionals eg I'd expect while(temp.next != None): to read while temp.next:
- functions are commented outside the function instead of in docstrings, which, ironically would have made it much better for learning the algorithms :-)
Not that it's bad code, it's just not very pythonic.
- Getters and setters are used all over the place (setData, getData etc)
- Strangely named variables - eg List = [] and newNode = Node(data)
- Non-pythonic conditionals eg I'd expect while(temp.next != None): to read while temp.next:
- functions are commented outside the function instead of in docstrings, which, ironically would have made it much better for learning the algorithms :-)
Not that it's bad code, it's just not very pythonic.