Scott on Writing

Musings on technical writing...

An Extensive Examination of Data Structures, Part 4 Available

A mere 10 days ago An Extensive Examination of Data Structures: Part 3 was published on MSDN.  Part 3 looked at trees, binary trees, and binary search trees (BSTs), and looked at implementing both binary tree and BST classes in C#.

Today, Part 4 of the article series was made available.  Part 4 starts with a quick look at self-balancing BSTs, and then moves on to an in-depth examination of skip lists, which are a randomized, mutated linked list that provides log2 n asymptotic time for searches, inserts, and deletes.  The article includes complete, working C# source code for the skip list class as well.  And, yes, Part 4 is another testament to my long-windedness, as it clocks in at 31 printed pages.  (In my defense, it's hard to be terse when talking about this topic matter; also, there are many pretty pictures and diagrams which quickly inflate the page count.)

Enjoy!

posted on Friday, February 20, 2004 2:31 PM

Feedback

# MSDN - Data Structures Part 4 2/20/2004 4:26 PM ThoughtChain

# re: An Extensive Examination of Data Structures, Part 4 Available 2/29/2004 1:54 PM Mike Singer

>…And, yes, Part 4 is another testament to my
> long-windedness, as it clocks in at 31 printed
> pages…

And at that, how about adding a few lines just to mention Knuth and Dijkstra. They deserve it, I’m sure.
Readers must get a knowledge of the sequence of inheritance in the namespace:

Knuth.SomeScientist.YetAnotherScientist.TheGreatScientistNamedScottMitchell

Best Regards,

Mike Singer :-)

# re: An Extensive Examination of Data Structures, Part 4 Available 2/29/2004 10:15 PM Scott Mitchell

Mike, I gave full credit to the creators of the AVL Tree, the Red-Black Tree, and the Skip List. Further, I cited the paper in which Pugh first mentions the skip list.

Yes, there are a plethora of computer scientists and mathematicians whose contributions were immense and worth discussing, but I don't think the place was this article. Knuth and Dijsktra are but two of the mountain of computer scientists worth mentioning. Why stop there? Why not talk about von Neumann, Backus, Rashid, Lampson, Lampart, Thompson, Ritchie, and countless others? Why stop at the computer scientists, what about those mathematicians and logicians who have contributed greatly to this field? Church, Turing, Carr, Godel, Post, Kleene, and (again) countless others?

*MANY* people deserve mention, but at 31 pages I'm already running a lengthy limit. I do cite the resources I use to formulate the article (primarily Cormen, Liessersen, and Rivest's work), and don't hesitate to give credit where credit is due.

# re: An Extensive Examination of Data Structures, Part 4 Available 3/1/2004 3:21 PM Mike Singer

> Why stop there? Why not talk about
> von Neumann, Backus… and countless others?

Perhaps you are right, I don’t know, Scott. Anyway your set of articles is a great resource.

It’s my fault, I think, to take the process of learning not like consuming McDonald’s food, but rather like getting into arts, history, great personages, trying to architecture knowledge, not just feed myself with the fast mental food. This could make me canonize some guys like Knuth, Dijsktra in prejudice of others.

# re: An Extensive Examination of Data Structures, Part 4 Available 3/1/2004 6:10 PM Scott Mitchell

******************************
It’s my fault, I think, to take the process of learning not like consuming McDonald’s food, but rather like getting into arts, history, great personages, trying to architecture knowledge, not just feed myself with the fast mental food.
******************************

This is the ideal type of learning, but you can't paint such a picture when you're limited in space. A book could provide such eloquence - a Web site article? Makes it much harder.

# re: An Extensive Examination of Data Structures, Part 4 Available 3/8/2004 2:56 AM Mike Singer

Scott, you've been translated into Russian by some student, congratulations.

http://www.gotdotnet.ru/LearnDotNet/Algorithms/31736.aspx

(An Extensive Examination of Data Structures Part 2)

He even hadn't edited your rather controversial statement about arrays at the beginning of the introduction:

“…The actual contents of an array are laid-out in memory as a contiguous block,…”

As far as I understand, sometimes it’s true about pointers to array elements, not about elements itself (actual contents of an array): array of strings, structures, objects…

Mike :o)

# re: An Extensive Examination of Data Structures, Part 4 Available 3/8/2004 9:12 AM Scott Mitchell

*********************************
He even hadn't edited your rather controversial statement about arrays at the beginning of the introduction:

“…The actual contents of an array are laid-out in memory as a contiguous block,…”

As far as I understand, sometimes it’s true about pointers to array elements, not about elements itself (actual contents of an array): array of strings, structures, objects…
*********************************

What an array "is" depends on what it's an array of. An array of a value type (ints, bools, etc.), is, indeed, a contiguous block of ints, bools, etc. An array of reference types is an array of references to that type. So, an array of FileInfo objects would have a contiguous block of references to FileInfo objects. These individual objects, though, could be scattered through the heap.

I discuss this in more detail (and provide some pretty pictures) in Part 1 [http://msdn.microsoft.com/vcsharp/default.aspx?pull=/library/en-us/dv_vstechart/html/datastructures_guide.asp] of the article series. In particular, reference Figures 1 and 2 from Part 1.

# re: An Extensive Examination of Data Structures, Part 4 Available 3/8/2004 11:34 PM Mike Singer

*********************************
What an array "is" depends on what it's an array of. An array of a value type (ints, bools, etc.), is, indeed, a contiguous block of ints, bools, etc. An array of reference types is an array of references to that type. So, an array of FileInfo objects would have a contiguous block of references to FileInfo objects. These individual objects, though, could be scattered through the heap.
*********************************

I suggest your articles might be a bit more stateless.

Imagine a VB.NET newbie who started only your 2 part just to get into “The Queue, Stack, and Hashtable”.

What he read at the beginning is:
“The array holds a set of homogeneous elements indexed by ordinal value. The actual contents of an array are laid-out in memory as a contiguous block”

How is he to figure out that an array of strings in VB.NET is actually an array of pointers to their addresses, not a contiguous block of bytes, containing these strings?

If he is smart enough to figure this out on his own, he most probably wouldn’t read the set of articles at all – he would head for the books you referenced at the end of the articles. This could be easier than trying to maintain pretty intricate state within the hole set of articles.

Mike.

# re: An Extensive Examination of Data Structures, Part 4 Available 3/9/2004 9:16 AM Scott Mitchell

************************************
I suggest your articles might be a bit more stateless.
************************************

Again, this is hard when you're limited to a Web article format where the publication of articles spans weeks, if not months.

Ideally this could be published as one big PDF or book or something...

Title:  
Name:  
Url:
Protected by Clearscreen.SharpHIPEnter the code you see:
Comments   

My Links

Ads Via DevMavens

Archives

Post Categories

 

I am a Microsoft MVP for ASP.NET.
I am an ASPInsider.
<March 2010>
SMTWTFS
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910

Comment Stats

DayTotal% of Total
Sunday 2056.8%
Monday 42514.1%
Tuesday 51917.2%
Wednesday 55518.4%
Thursday 58019.2%
Friday 54718.1%
Saturday 1886.2%
Total 3019100.0%

Hour1Total% of Total
12:00 AM 782.6%
1:00 AM 812.7%
2:00 AM 682.3%
3:00 AM 822.7%
4:00 AM 692.3%
5:00 AM 1264.2%
6:00 AM 1183.9%
7:00 AM 1816.0%
8:00 AM 1926.4%
9:00 AM 1585.2%
10:00 AM 1886.2%
11:00 AM 1936.4%
12:00 PM 2016.7%
1:00 PM 1846.1%
2:00 PM 1695.6%
3:00 PM 1354.5%
4:00 PM 1153.8%
5:00 PM 1073.5%
6:00 PM 1013.3%
7:00 PM 1073.5%
8:00 PM 923.0%
9:00 PM 882.9%
10:00 PM 913.0%
11:00 PM 953.1%
Total 3019100.0%

Comments by Blog Entry Date/Time

Day Entry MadeAvg.Total
Sunday 4.97159
Monday 4.80384
Tuesday 4.04477
Wednesday 7.39680
Thursday 6.26676
Friday 5.07466
Saturday 4.78177
Total 5.403019

Hour1 Entry MadeAvg.Total
12:00 AM 5.2937
1:00 AM 1.002
5:00 AM 0.000
7:00 AM 3.8550
8:00 AM 3.72134
9:00 AM 6.06297
10:00 AM 5.63276
11:00 AM 4.22194
12:00 PM 6.16351
1:00 PM 3.09133
2:00 PM 4.89230
3:00 PM 7.64321
4:00 PM 4.00108
5:00 PM 6.07170
6:00 PM 4.64116
7:00 PM 8.95188
8:00 PM 8.63164
9:00 PM 5.00115
10:00 PM 6.31101
11:00 PM 4.5732
Total 5.403019

Learn More About Comment Stats
1 - All times GMT -8...


Blog Stats

Favorite Web Sites

My Books

My MSDN Articles