This textbook aims to cover what CS majors learn in an introductory data structures and algorithms programming course.
Do we want to do everything for this subject on one page, or make this just a page of links? I like the second idea better.
I prefer dropping new information here until a section gets "too big". Then split off that section onto its own page. Seehttp://CommunityWiki.org/BigBucketsFirst --DavidCary 05:41, 12 Jul 2004 (UTC)
I agree with that article's logic. I'll copy the material from my linked list page back to this page, and work on it here. Later on, maybe we'll span off to other pages aka buckets. --Waxmop
I'd like to join the project if I may. I'm ready to tackle a couple of these topics. Is there a particular format to use?--Wcrowe 21:34, 1 Jul 2004 (UTC)
I would like to suggest a change in the order of the chapters. I would like to have Graphs moved before Trees, as a tree is simply a special case of a graph.Pesto04:11, 28 August 2005 (UTC)
If you write an article, you get to choose the format. Later on, people might improve the format, but at the beginning, we should just get out something and let people work on refining later. --Waxmop 17:15, 4 Jul 2004 (UTC)
We should use header markup (with the equal signs) rather than bullet markup. The header markup builds the table of contents. Also, we should put articles into the Programming:Data_Structures namespace for now. I'm starting a linked list article. --Waxmop 17:22, 4 Jul 2004 (UTC)
It links to a javascript page right now that I don't think is relevant. Everyone: remember to use the namespace Programming:Data Structures:your topic for your articles.--Waxmop 22:55, 5 Jul 2004 (UTC)
This is a textbook, therefore, IMO, sections should use a how-to approach. You will immediately see that this differs quite a bit from an encyclopedic approach. I hope it is everyone's intent toteach these subjects, step by step, rather than just create a collection of Wikipedia links.
I'd rather not make a large change without some discussion, but it seems to me that the sorting portion should be moved to the bottom. I kind of visualize this page as three sections:
I wasn't planning on laying out the whole menu. I just meant to put in some examples, but I went further than I intended. I think that this breakdown gives us better control over presenting pros & cons of collection selections (Since the list selections are together and the stack selections are together), and is more consistant.
Primary Storage Types Single object allocation (used to implements linked lists, most trees, ...) Array (used to implement array list, most stacks, circular queues, ...)Secondary Storage Types Lists Common list operations & example Set(pos, val), Get(pos), remove(pos), append(val) Implemented as a Linked List Single linked list Double linked list Implemented as an Array List Stacks Common stack operations & example Push(val), Pop (, peek?) Implemented on a Linked List Implemented on an array Queues Common queue operations & example enqueue, dequeue Implemented as LinkedList Implemented as an array (circular, fixed size queue) Special cases Dequeues (What is this used for, by the way?) Trees & Graphs (isn't a tree just a special case of a graph?) Common tree operations & example add, get, remove Implemented as links (like linked list) Implemented in an array (Heap) Special cases Binary tree Balanced Quad tree Graphs Hash Tables ...How do I choose a data structure for a given situation? Sorts Big O notation Combinations ArrayList and Hashtable ...
--BillKress 23:06, 5 Nov 2004 (UTC)
Introduction What is Data Abstraction?The Node The most elementary data structureArrays Matricies: two dimensional arrays Insertion sort on an array Binary search on a sorted arrayList Structures Common list operations & example set(pos, val), get(pos), remove(pos), append(val) [not sure about these operations: what about next()? or iterators?] [Perhaps discuss operations on Nodes, versus operations on the List itself: example, Nodes have a next operation, but the List itself has a pointer to the head and tail node, and an integer for the number of elements. This view would work well in both the Lisp and OO worlds.] Doubley linked list Vectors (resizeable arrays)Iterators Operating on sequences without knowledge of the sequence itselfStacks and Queues Common stack operations & example push(val), pop, and peek Implemented on a Linked List Implemented on an array Common queue operations & example enqueue, dequeue Implemented as LinkedList Implemented as an array (circular, fixed size queue) DequeuesTrees Common tree operations & example add, get, remove Binary trees in order, pre order, post order traversals Balanced binary trees Iterators for treesMin and Max Heaps A tree implemented as an array! (not to be confused with the heap in memory) Percolation Heap sort Treaps: heaps where elements can be deleted by nameGraphs Directed and Undirected graphs matrix and list representations Depth-First Search Breadth-First Search Topological sortHash Tables Iteration order for hash tables by augmenting the structure - iterating over items in the order in which they were inserted - iterating over the items based on most-recently-usedSets Different implementations - lists, binary search trees, bit arrays, hashtables Disjoint Sets (operations: union, find)Tradeoffs between Data Structures Use asymptotic behaviour to decide, most importantly seeing how the structure will beused: an infrequent operation does not need to be fast if it means everything else will be much faster
The content is designed to compliment the Algorithms text book (the idea is that the reader would cover the DS book first, then the Algo book, and then theAdvanced Data Structures and Algorithms book that would pick up the more random and advanced ideas). Most importantly, I'd like to see each book be small enough that it can be read completely in one or two semesters. The more reference-based or encyclopedic content could be saved for either the Advanced book or the wikipedia.MShonle 01:00, 21 Dec 2004 (UTC)
I agree. I find it odd that a lot of list based structures are currently placed under linked lists, when these structures can obviously be impleneted as an array.
Your layout looks good, but I was wondering if we can add a disccusion about big O notation. I see it used here, but where is it formally defined?
Gdarwin 16:13, 29 Oct 2004 (UTC)
Proposed structure has been modified. I'd still like to hear one or two more people say that they prefer this structure before I refactor.
--BillKress 23:04, 5 Nov 2004 (UTC)
Currently we have some 2 articles on arrays one here and one inProgramming:Arrays. We should merge realy leavin only a short into here and move the rest off.
array [Jan ... Dez, 1990 ... 2005] of .... should not be out of the question. --Krischik06:47, 23 August 2005 (UTC)The above quote is incorrect. The original quicksort introduced by Hoare used random, not deterministic, methods to select the pivot. Thus, the kind of data input (random or ordered) wasn't important. It would only perform poorly on the very slight chance that the random selections were suboptimal. Some bad textbooks present some pretty poor ways of picking the pivots, but that is not the true quicksort.
I think it would probably be best not to present quicksort in the data-structures book at all because it's already half-way covered in the Algorithms book (currently the partition portion of quicksort is covered). I think Bubble sort probably shouldn't even be mentioned, as selection sort performs better and is easier to understand. For a data-structures book, Heap sort makes the most sense. Part of my hope is that we can keep both the data-structures and algorithms books simple (by covering only the most fundamental tools), and get into the more advanced material (e.g. introsort) in anAdvanced Data-Structures and Algorithms book.MShonle 19:34, 20 Dec 2004 (UTC)
It looks like we've resolved many of the issues on this page. How would one go about archiving this talk page?MShonle 19:18, 30 Dec 2004 (UTC)
Here's the page structure I have for the Introduction, and I'd like to repeat it for the other chapters:
Computer Science:Data Structures:Introduction -- simple page that includes: a header {{Computer Science:Data StructuresChapNav}}, - i.e. a template {{Computer Science:Data Structures:Introduction}}, - another template a horizontal line a footer {{Computer Science:Data StructuresChapNav}}, - the same template as the headerwhere the template {{Computer Science:Data Structures:Introduction}} is:Template:Computer Science:Data Structures:Introduction -- a simple page that REDIRECTS to the page Computer Science:Data Structures:Introduction_contentComputer Science:Data Structures:Introduction_content -- the article that includes the chapter's *real* content.The idea of these template tricks is two fold:
The by-chapter view is the one shown above. The all-chapters view would be a page that would look like this:
{{Computer Science:Data Structures:Introduction}} {{Computer Science:Data Structures:Chapter 2}} {{Computer Science:Data Structures:Chapter 3}} ... and so on, including all of the _content pages (indirectly, because the templates will redirect)The indirection is neccessary in order to avoid the chapter navigation getting shown in the all-chapters view.
The idea behind the all chapters view is that people could print out the book easily. Anyway, if you see some weird things, like the above, that's the reason why.MShonle 19:47, 30 Dec 2004 (UTC)
I've implemented theStack ADT in a pseudocode that I'm proposing for the rest of the book. I used a literate programming approach in which the implementation is interspersed with prose describing it. The pseudocode for a somewhat more complicated ADT should probably be copied here and used for an example. The details of the pseudocode follow.
All blocks begin with a keyword (so fartype andmethod) and end with a line containingend and the keyword. The pseudocode is sensitive to line endings, although a python-like use of; to put two commands on the same line would not be unreasonable. Make sure you indent the contents of all blocks.
I usetypeTypeName[<type-arguments>] to introduce a new type. I use the word "type" rather than an alternative like "class" or "structure" because this is a book on abstract data types, rather than object oriented classes, and the word "structure" is too long. I drew the angle brackets from C++ template or Java generic syntax. I think it is important to point out that abstract types are parametrized on other types. The type ends withend type on its own line.
Thedata keyword declares a private data member. It is of the formdatamember-name:member-type. I am using the Pascal style of data typing (: to introduce the type of a variable) because there's already a keyword in front of the variable and this allows us to use type names with spaces in them. Data members (so far) can be accessed by their name alone in any member function. Possibly, we should follow python's lead and require a "self." in front of an access to clearly distinguish them from local variables.
method introduces a public member function/method. These are of the formmethodmethod-name (arg-1:arg-1-type,…) [:return-type]. A method ends withend method on its own line. If a return type is present, areturn statement with the right type must terminate all calls of the function. Probably we should find a way to indicate that a method does not modify its object or an argument. You call a member function using the standardobject.member(args) syntax.
I'd like afor loop that allows iteration over either a numeric range with a possible stride, or over all members of a given set or sequence. Perhaps the following syntax:
for i in 1..11 [step 2] # Does this loop for i=11 or not?for i in some_set
Pattern matching should probably be allowed too:
for (first,second) in pair_sequence
Old discussion from above:
On the history page, Krischik said: "(Discussion - pseudocode vs real language - why not both?)". Answer: Weare taking that approach. If people want to supply implementations in C, Scheme, Python or Java they may do so, as an appendix (the sister Algorithms book has one appendix already set up, but with little work done on it). The pseudo-language is closest to Python, so it would be a good idea to test all of the samples by actually running them against a full test-suite (which should also be part of the appendix; see the Algorithms book).MShonle14:35, 23 August 2005 (UTC)
Jyasskin said: "In a couple places, MShonle has suggested that this book's pseudocode should not use generics, instead leaving certain variables untyped. I respectfully disagree."
hi there!i just started reading this book, like it so far, but one thing conufses me:every chapter uses a diferent pseudocode; this realy makes it hard to follow...
The references section should have its own _content page, so that it could be seen on the All Chapters view version of the book too. Possibily we'll want to do this for the preamble too.MShonle20:59, 7 September 2005 (UTC)
Will this wikibook have reviews for each chapter, or perhaps quizzes, or even a test/project? I didn't really see any mention of this in the intro. Just wondering. I may be able to help with these.Gflores02:24, 31 October 2005 (UTC)
I was just looking at the history of some of the modules and some date back to February. Is this book still active?
I noticed the part saying that implementations in various languages would be welcome as an Appendix. I agree that this is a good idea, and would be willing to add some of them. I'm not sure what a good structure would be. Have a page as the appendix with everything on it? A page as the appendix with links to pages for individual structures, featuring an implementation in each language, and/or links to pages for each language, featuring an implementation of each structure mentioned in the book. Any thoughts?Cat Parade06:39, 8 March 2006 (UTC)
--Adrignolatalkcontribs13:39, 17 May 2010 (UTC)
I would like to see the book cover Hash Trees regarding structures, traversal and uses. --Panic (talk)02:31, 20 May 2010 (UTC)
Just a note for editors (and anyone doing administrative work) on the project's namespace. There is no need to add {{BookCat}} at all on subpages that already use the {{Data Structures/ChapNav}} template (it is already included there). This also means you don't want the direct category addition below the template, which will upset the sorting that BookCat provides (would sort on D rather than H).
This should probably be listed in a specific book convention page that explains what and how to use the navegation templates. --Panic (discuss •contribs)09:42, 28 October 2011 (UTC)