Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
courses:cs211:winter2011:journals:camille:chapter5 [2011/03/09 00:22] – [Section 3: Counting Inversions] cobbc | courses:cs211:winter2011:journals:camille:chapter5 [2011/03/13 22:18] (current) – [Section 5: Integer Multiplication] cobbc | ||
---|---|---|---|
Line 35: | Line 35: | ||
* **Summary: | * **Summary: | ||
+ | This problem also uses the same techniques. Given a set of n points in a plane, find the pair that's the closest together. They talk about the history of the problem and get into notation, but I'm going to assume I'll remember that or that I'll find the notation intuitive. The 1-D problem is useful to think about. If all of the points are along a line, then you just need to sort them on the line (O(nlogn) time) and then you can go through and just look at the next point along the line and keep track of the minimum distance and which points it was between. The 2-D problem can be solved by sorting according to one coordinate, splitting the points into two halves, finding the closest two points in each half recursively, | ||
* **Insights and Questions: | * **Insights and Questions: | ||
+ | They say that you can get the running time down to O(n) with randomization. This isn't necessarily directly in reference to this particular problem, but in general I just don't understand how randomization can help solve problems more quickly. Hmm. | ||
+ | |||
* **Readability: | * **Readability: | ||
+ | Great! They' | ||
+ | |||
+ | ===== Section 5: Integer Multiplication ===== | ||
+ | |||
+ | * **Summary: | ||
+ | This problem will reduce running time by having more than two recursive calls at each level. The elementary school way of multiplying two numbers takes O(n^2) time, which is good, but it could be better. Instead of doing it that way, though, you can separate n-bit binary numbers (they say it works for other number systems, too) into two n/2-bit binary numbers (the first n/2 digits, " | ||
+ | |||
+ | * **Insights and Questions: | ||
+ | This is a really interesting example of how differently computers and people think. There' | ||
+ | |||
+ | * **Readability: | ||
+ | I thought that, once again, this section was very readable! |