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.

Basic Data Structures and Algorithms in the Linux Kernel

682 pointsby jackhammer2022over 11 years ago

16 comments

timsallyover 11 years ago
Great material, but it&#x27;s been directly taken from the source material (<a href="http://cstheory.stackexchange.com/questions/19759/core-algorithms-deployed/19773#19773" rel="nofollow">http:&#x2F;&#x2F;cstheory.stackexchange.com&#x2F;questions&#x2F;19759&#x2F;core-algor...</a>) with no added content. I imagine Vijay (the author of the source material) put a lot of work into assembling this information. Vijay&#x27;s CS Theory answer should replaced as the URL for this HN submission.<p>EDIT: Removed part of my comment, per the blog author&#x27;s response below.
评论 #6788125 未加载
评论 #6788146 未加载
bcjordanover 11 years ago
A Coding for Interviews [1] group member mentioned that reading through the Java collections library [2] was the most valuable step he took while preparing for his Google interviews.<p>In addition to getting a better understanding the standard data structures, hearing a candidate say &quot;well the Java collections library uses this strategy...&quot; is a strong positive signal.<p>[1]: <a href="http://codingforinterviews.com" rel="nofollow">http:&#x2F;&#x2F;codingforinterviews.com</a><p>[2]: He suggested reading the libraries here: <a href="http://www.docjar.com/html/api/java/util/HashMap.java.html" rel="nofollow">http:&#x2F;&#x2F;www.docjar.com&#x2F;html&#x2F;api&#x2F;java&#x2F;util&#x2F;HashMap.java.html</a>
评论 #6789655 未加载
评论 #6789715 未加载
评论 #6789602 未加载
incisionover 11 years ago
Very nice summary.<p>I encountered many of these while reading through <i>Understanding The Linux Kernel</i> [0] and <i>The Linux Programming Interface</i> [1].<p>Both are great books which are primarily about the &quot;how&quot; of the kernel, but cover a lot of the &quot;why&quot; of the design and algorithms as well.<p>0: <a href="http://www.amazon.com/dp/0596005652" rel="nofollow">http:&#x2F;&#x2F;www.amazon.com&#x2F;dp&#x2F;0596005652</a><p>1: <a href="http://www.amazon.com/dp/1593272200" rel="nofollow">http:&#x2F;&#x2F;www.amazon.com&#x2F;dp&#x2F;1593272200</a>
评论 #6788793 未加载
评论 #6789968 未加载
netvarunover 11 years ago
On a (slightly) related note, you should also check out the author Vijay&#x27;s (<a href="http://www.eecs.berkeley.edu/~vijayd/#about" rel="nofollow">http:&#x2F;&#x2F;www.eecs.berkeley.edu&#x2F;~vijayd&#x2F;#about</a>) answer on the benefits of learning Finite Automata: <a href="http://cstheory.stackexchange.com/questions/14811/what-is-the-enlightenment-im-supposed-to-attain-after-studying-finite-automata/14818#14818" rel="nofollow">http:&#x2F;&#x2F;cstheory.stackexchange.com&#x2F;questions&#x2F;14811&#x2F;what-is-th...</a>
评论 #6789579 未加载
评论 #6788995 未加载
eshvkover 11 years ago
The stack exchange comment was amazing. You can&#x27;t get a better raison d&#x27;etre for why studying algorithms is important.
评论 #6789237 未加载
评论 #6788655 未加载
jackhammer2022over 11 years ago
More implementations listed at: <a href="http://cstheory.stackexchange.com/a/19773" rel="nofollow">http:&#x2F;&#x2F;cstheory.stackexchange.com&#x2F;a&#x2F;19773</a>
评论 #6788111 未加载
评论 #6791195 未加载
mrcactu5over 11 years ago
I like reading these off stack-exchange since I am often to lazy to read the textbook.<p>My other problem with algorithms textbooks is that I get into arguments <i>with other developers</i> about how much we need them. At least here, I can say &quot;Look bucko, the Linux kernel itself uses them.&quot;<p>I decided we can do programming at the API level and never have to think to <i>how</i> that API gives us the right answer. Lower-level programming is responsible for optimization when our number of data points gets larger.<p>And we could go even lower level and ask why the algorithms work in the first place - which is the computer science aspect. I routinely deal with developers who feel they do not have time for this.<p>Also, if the data is small enough scale, we can brute-force it and nobody will notice.
joshguthrieover 11 years ago
These are great resources. Best advice I was ever given when starting CS and learning C was from the headmaster (hi RR!) asking me &quot;What about Linus&#x27;s linked-list? Have you looked at them?&quot;.<p>Up to that point, this (new) headmaster was seen by the students as &quot;that non-tech guy here to administrate the school&quot; and he was opening my eyes on the biggest codebase residing on my own computer that I never bothered looking through: the Linux kernel code.<p>As someone says further down the comments, this is not a specific Linux thing: looking at how Java HashMaps works or how Ruby implements &quot;map&quot; are great resources and you&#x27;ll always get bonus points in an interview for referencing algorithms from &quot;proven&quot; source codes.
aviskover 11 years ago
Awesome answer. This is a treasure for anybody wanting to read data structures &amp; algorithms. I always felt bored to read data structures for the sake of reading them or for interviews with some made up examples. I am sure we can quote many other open source projects with interesting uses of these data structures. This is way more interesting than reading source code of data structure libraries in programming languages.
aceperryover 11 years ago
Excellent, I love reading this stuff. Very helpful and informative for those of us who are interested in computer science but studied in a different field.
chintanpover 11 years ago
My favorite algorithm has been the linked list implementation, pretty useful for implementing list on embedded platforms.
评论 #6788831 未加载
评论 #6789322 未加载
评论 #6789004 未加载
alok-gover 11 years ago
Wow! Does anyone know more about the author Vijay D.? Is this the person: <a href="http://www.eecs.berkeley.edu/~vijayd/" rel="nofollow">http:&#x2F;&#x2F;www.eecs.berkeley.edu&#x2F;~vijayd&#x2F;</a>
评论 #6790708 未加载
topynateover 11 years ago
Could someone explain what the utility of bubble sort is? I&#x27;ve read that even in cases where an O(nlogn) sort is impractical, insertion or selection sort is preferred.
评论 #6789357 未加载
评论 #6790430 未加载
almosnowover 11 years ago
Amazing answer!, unfortunately &#x27;this is not a good fit for our Q&amp;A format&#x27;.
评论 #6789534 未加载
blahbl4hblahtooover 11 years ago
Wow. That&#x27;s so cool.
ExpiredLinkover 11 years ago
I&#x27;d be interested in Basic Data Structures and Algorithms in C that are published under a non-viral license.