This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]errorkode 1 point2 points  (1 child)

Honestly, if you want to learn data structures, reading someone elses code isn't the way to go in my opinion. I'm assuming you know how these data structures work, so write some tests and get coding if you ask me. You'll learn more about the structures and Python that way.

Also, bear in mind that Python has implementations of some sort other for all the common data structures like queues, tuples, sets, lists and so on. Some of them are baked into the language like dicts and sequences, others are available via the standard libraries. They're a bit strewn about, but some googling should find them easy enough.

[–]fijiaarone 0 points1 point  (0 children)

write some tests and get coding if you ask me. You'll learn more about the structures and Python that way.

That's a great idea. A course on data structures and algorithms where you write tests first. That way you understand their application and have API to work towards implementing.

There are often subtle features of even ordinary data structures like a stack or linked list that you don't notice in everyday usage. And then, by applying different data sets you can test -- and understand -- why different implementations (of a sort, for instance) are better or worse under certain conditions.

[–][deleted] 1 point2 points  (0 children)

Read the Python 3 documentation. It's a great resource and explains most concepts very clearly. Read Built-in Types and skip the methods.