#13 in Algorithms and data structures books
Use arrows to jump to the previous/next product

Reddit mentions of The Art of Computer Programming: Volume 3: Sorting and Searching (2nd Edition)

Sentiment score: 3
Reddit mentions: 5

We found 5 Reddit mentions of The Art of Computer Programming: Volume 3: Sorting and Searching (2nd Edition). Here are the top ones.

The Art of Computer Programming: Volume 3: Sorting and Searching (2nd Edition)
Buying options
View on Amazon.com
or
    Features:
  • Used Book in Good Condition
Specs:
ColorCream
Height1.71 Inches
Length9.49 Inches
Number of items1
Weight3.05781157394 Pounds
Width6.65 Inches

idea-bulb Interested in what Redditors like? Check out our Shuffle feature

Shuffle: random products popular on Reddit

Found 5 comments on The Art of Computer Programming: Volume 3: Sorting and Searching (2nd Edition):

u/the_gnarts · 3 pointsr/ProgrammerHumor

> what is a good resource to learn about search functions?

Knuth vol. 3 is as canonical
an answer as you can get.

u/liverandeggsandmore · 2 pointsr/videos

The Wikipedia article "Sorting Algorithm" is a good place to start.

The best place to finish is with Don Knuth's Art of Computer Programming, Volume 3: Sorting and Searching.

u/know_prashant · 2 pointsr/learnprogramming

Sorting and Searching are one of the oldest yet one of the most modern algorithm which are going in rapid development. This topic so much studied that Donald Knuth has an entire book dedicated to this topic https://www.amazon.com/Art-Computer-Programming-Sorting-Searching/dp/0201896850

u/Neres28 · 2 pointsr/learnprogramming

A hash function is a function (in the literal sense) that takes an element of some large element space and returns an element of a smaller element space. A typical hashing function takes a string and returns an int.

A naive, but instructional, version of a string hashing function:

int hash(String string){
int value = 0;
for(char c : string){
value += (int)c;
}
return value;
}

The largest problem with the above, ignoring the potential overflow, is that it does a poor job of distributing elements from the String space to the integer space. For instance the strings "abc" and "cba" map to the same integer. Perhaps the worst part of the above is that it is terribly nonuniform. It strongly favors the lower range of the integer space. See this for a few good alternative string hashes. See this for a discussion of various hashing methods and their performance. See Knuth's Sorting and Searching page 514 for an explanation of what makes a good hashing function and how to write one.

So now that we have a means to convert a string to an representative integer, how can we use that to look up and store elements in an array? We could use the hash function as the index of the element in the array, but since the hash could conceivably return INT_MAX we'd need an array of that many elements, potentially impossible and definitely a waste of space. The easiest way is to simply mod (%) the hash value by the size of our array, yielding a value within the range of our array.

But there's a problem, right? 1. our hash function could map two different strings to the same integer, and 2. our modulus operation could map two different hashes to the same index. How do we resolve this conflict, or collision as it is called? There's a few different methods, but I think the one you're thinking about is typically referred to as separate chaining. What this means is that when storing an element, we take it's array index, as computed by the modulus of the hash of its key, and look at that array slot. That slot holds a pointer to a linked list that we insert our element into. When doing a lookup we do the same thing to get to the linked list, then traverse the list in the standard fashion looking for our element. In the best case, where we have a lot more slots than elements to be stored, we get constant time insertions, and near constant time retrievals. In the worst case, where every hash value degenerates to the same array index we get constant time insertions (assuming we insert at the head of the linked lists) and linear time retrievals (since our fancy data structure has degenerated to a linear search of a linked list).

u/gawen · 1 pointr/AskReddit

To enter a great engineer school in France, you need to do what is named a TIPE. This is a kind of mini-thesis about a scientific topic you need to present orally. My topic was about sorting algorithms. I studied really really hard for one year, I read the best book about the subject and my trainers told me it was one of the finest work they've seen.

People to whom I present my thesis thought I wasn't the author of the thesis because I "could not do such a good job". The note they gave me was disqualifying. I could not enter the engineer school I wanted because of this.

I knew later these people weren't computer science specialist, but secondary school's physic & biology teachers. They were two, one of them was playing with his pen half of the time of my oral.

Makes 5 years now since this event. When I think about it, I'm still shocked by how a single event can change your personnality, your life, and your faith in humanity.

TL;DR: hard-worked to present a mini-thesis to people who thought I wasn't its author, which disqualified me to enter in one of the greatest school in France