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   

Add To Your Reader

My Links

Archives

Post Categories

 

I am a Microsoft MVP for ASP.NET.
I am an ASPInsider.
<May 2008>
SMTWTFS
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

Comment Stats

DayTotal% of Total
Sunday 1866.8%
Monday 37913.9%
Tuesday 45316.7%
Wednesday 50418.5%
Thursday 53519.7%
Friday 49418.2%
Saturday 1666.1%
Total 2717100.0%

Hour1Total% of Total
12:00 AM 652.4%
1:00 AM 682.5%
2:00 AM 622.3%
3:00 AM 742.7%
4:00 AM 572.1%
5:00 AM 1033.8%
6:00 AM 1084.0%
7:00 AM 1585.8%
8:00 AM 1716.3%
9:00 AM 1475.4%
10:00 AM 1716.3%
11:00 AM 1816.7%
12:00 PM 1886.9%
1:00 PM 1696.2%
2:00 PM 1605.9%
3:00 PM 1324.9%
4:00 PM 1073.9%
5:00 PM 923.4%
6:00 PM 913.3%
7:00 PM 963.5%
8:00 PM 833.1%
9:00 PM 782.9%
10:00 PM 792.9%
11:00 PM 772.8%
Total 2717100.0%

Comments by Blog Entry Date/Time

Day Entry MadeAvg.Total
Sunday 5.54144
Monday 5.22339
Tuesday 4.28419
Wednesday 7.67637
Thursday 6.90607
Friday 5.48411
Saturday 5.33160
Total 5.842717

Hour1 Entry MadeAvg.Total
12:00 AM 5.0035
1:00 AM 1.002
5:00 AM 0.000
7:00 AM 7.0035
8:00 AM 5.35107
9:00 AM 6.32278
10:00 AM 6.47246
11:00 AM 4.41181
12:00 PM 6.88330
1:00 PM 3.00111
2:00 PM 5.41222
3:00 PM 8.64285
4:00 PM 4.0589
5:00 PM 5.92154
6:00 PM 4.52113
7:00 PM 9.67174
8:00 PM 9.80147
9:00 PM 5.05111
10:00 PM 5.4265
11:00 PM 4.5732
Total 5.842717

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


Blog Stats

Favorite Web Sites

My Books

My MSDN Articles