# Data Structures and Algorithms book flying out (again!)

Published Mon, Dec 22 2008 2:48

The updated version of the Data Structures and Algorithms book that Luca and I wrote is flying out once more! We are really very happy to see how many people are downloading our book. In total (counting the previous release) the book has had nearly 16,000 downloads! Amazing.

If you haven’t already got a copy what are you waiting for?! Its free so you don’t have to reach into those empty pockets at this time of year.

Download the updated version of the Data Structures and Algorithms book here!

Enjoy. Merry Christmas and a Happy New Year.

# Dew Drop - December 22, 2008 | Alvin Ashcraft's Morning Dew said on Monday, December 22, 2008 8:50 AM

Pingback from  Dew Drop - December 22, 2008 | Alvin Ashcraft's Morning Dew

# Phil Duby said on Tuesday, December 23, 2008 3:46 PM

Chapter 5: Sets; Intersection

While traversing the smallerset, there is no need to check if the smallerset contains the item.  That is already known, or it would not have been found during the traversal.  Syntax adjusted to use what this form allows.

1) algorithm Intersection(set1, set2)

2) Pre: set1, and set2 not 1 emptySet

3) intersection, smallerSet and largerSet are sets

3) Post: An intersection of set1, and set2 has been created

4) if set1.Count < set2.Count

5) smallerSet is set1

6) largerSet is set2

7) else

8) smallerSet is set2

9) largerSet is set1

10) end if

11) foreach item in smallerSet

12) if largerSet.Contains(item)

14) end if

15) end foreach

16) return intersection

17) end Intersection

Alternative,

1) algorithm Intersection(set1, set2)

2) Pre: set1, and set2 not 1 emptySet

3) intersection is a set

3) Post: An intersection of set1, and set2 has been created

4) if set1.Count < set2.Count

5) foreach item in set1

6) if set2.Contains(item)

8) end if

9) end foreach

10) else

11) foreach item in set2

12) if set1.Contains(item)

14) end if

15) end foreach

16) end if

17) return intersection

18) end Intersection

# Think Before Coding said on Wednesday, December 24, 2008 4:22 AM

I had a peek through Jon Skeet’s blog this morning at a free eBook called Data Structures and Algorithms by Granville Barnett and Luca Del Tongo. The book is clear and presents the usual linked lists, trees, sets structures in a concise yet precise

# Granville Barnett said on Wednesday, December 24, 2008 5:32 AM

Hi Phil,

I'll recheck the algorithm when I have some time (which is hard to find these days).

Thanks.

# newbie said on Wednesday, January 07, 2009 12:43 PM

Hi,

Thanks

# Granville Barnett said on Wednesday, January 07, 2009 9:54 PM

Hi newbie (although I has a feeling thats not your name ;-)),

All the source code for the book is the book itself. The examples given can be translated relatively friction free to your respective imperative language of choice. However, if you want an implementation then we have one on offer in the DSA CodePlex project - http://codeplex.com/dsa which is all done in C#.

HTH

(required)
(required)
(optional)
(required)

Enter the numbers above: