TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Problem Solving with Algorithms and Data Structures Using Python

294 pointsby samrohnover 6 years ago

8 comments

notafraudsterover 6 years ago
I opened 1.8.1 because I thought it&#x27;d be the first section with code and the code was not PEP-8 compliant. Having a brief scan, the authors seem to have a pretty severe aversion to putting spaces after commas, which is a bummer because it really impacts code readability. It&#x27;s inconsistent even from line to line, so it&#x27;s not a style thing. They&#x27;re also inconsistent about using single and double quotes for strings.<p>I skipped ahead to &quot;implementing a stack in python&quot;, which is a little weird because the stack class they implement is just a thin wrapper around lists with append aliased to push and &quot;self.items[len(self.items)-1]&quot; aliased to peek (note: in python you can just use negative indexing to access items near the end of a list)<p>This might seem pedantic, but, like, if the book isn&#x27;t leveraging Python and it&#x27;s not particularly clean code then I don&#x27;t really understand what&#x27;s on offer here.
评论 #18731899 未加载
评论 #18734750 未加载
评论 #18733701 未加载
评论 #18734460 未加载
qwerty456127over 6 years ago
Is there an alike book that would provide functional implementations of the algorithms alongside or instead of imperative ones? In Python preferably but I don&#x27;t mind any other language. I would like to learn implementing algorithms and solving problems the functional way.
评论 #18731556 未加载
评论 #18731618 未加载
评论 #18732911 未加载
评论 #18731798 未加载
djaychelaover 6 years ago
Previous discussion (March 2017, with link dated 2015):<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=13854087" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=13854087</a>
raymondhover 6 years ago
Ironically, the provided implementations for Queue and Deque are algorithmically terrible, giving O(n) performance for operations that should be O(1).<p>Queue and Deque could easily be developed from first principles by building on dictionaries or linked lists. It was a mistake to use list operations like s.pop(0) and s.insert(0, x).
easythingsover 6 years ago
Hey, here the some key points to know about algorithms, machine learning and python. Just check it out <a href="https:&#x2F;&#x2F;www.easythings.xyz&#x2F;2018&#x2F;07&#x2F;machine-learning-algorithms-develop-sounds.html" rel="nofollow">https:&#x2F;&#x2F;www.easythings.xyz&#x2F;2018&#x2F;07&#x2F;machine-learning-algorith...</a>
asicspover 6 years ago
and for beginners to programming and Python, the same site provides this excellent course: <a href="https:&#x2F;&#x2F;interactivepython.org&#x2F;runestone&#x2F;static&#x2F;thinkcspy&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;interactivepython.org&#x2F;runestone&#x2F;static&#x2F;thinkcspy&#x2F;ind...</a>
jammygitover 6 years ago
In school I was quite confused about how merge sorts worked until I got a deck of cards and walked through the algorithm a few times. This site made it dead simple though. If only I&#x27;d had it instead of my textbook
monk_e_boyover 6 years ago
Sweet! That covers a lot of what I&#x27;m about to teach :)