Data Structures and Algorithms book flying out (again!)

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!

dsa

Enjoy. Merry Christmas and a Happy New Year.

Published Mon, Dec 22 2008 2:48 by Granville Barnett

Comments

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

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

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

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)

13) intersection.Add(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)

7) intersection.Add(item)

8) end if

9) end foreach

10) else

11) foreach item in set2

12) if set1.Contains(item)

13) intersection.Add(item)

14) end if

15) end foreach

16) end if

17) return intersection

18) end Intersection

Tuesday, December 23, 2008 3:46 PM by Phil Duby

# Data Structures and Algorithms

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

Wednesday, December 24, 2008 4:22 AM by Think Before Coding

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

Hi Phil,

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

Thanks.

Wednesday, December 24, 2008 5:32 AM by Granville Barnett

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

Hi,

Where can you download the source code for the book?

Thanks

Wednesday, January 07, 2009 12:43 PM by newbie

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

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

Wednesday, January 07, 2009 9:54 PM by Granville Barnett

Leave a Comment

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