Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #111535

Re: PEP Request: Advanced Data Structures

From cs@zip.com.au
Newsgroups comp.lang.python
Subject Re: PEP Request: Advanced Data Structures
Date 2016-07-17 10:54 +1000
Message-ID <mailman.48.1468718475.2307.python-list@python.org> (permalink)
References <fphlobd109lvi2e4r4oe4qjpcf97chhe67@4ax.com> <20160717005426.GA50011@cskk.homeip.net>

Show all headers | View raw


On 16Jul2016 19:49, Dennis Lee Bieber <wlfraed@ix.netcom.com> wrote:
>On Sat, 16 Jul 2016 15:33:12 -0700 (PDT), Shrey Desai
><shrey.desai@gmail.com> declaimed the following:
>>- Education: the Linked List is a core data structure that CS undergraduates 
>>(among others) use and study, so it is vital that they have hands on access 
>>to them. A list is basically a dynamic array; the only property it shares 
>>with a Linked List is that it's dynamic.
>
>	My CS courses required us to implement our own linked lists (in FORTRAN
>IV yet). Providing a built-in linked list just negates the educational
>aspect.

I was thinking this exact same thing.

>>- Development: the use of correct data structures is important when 
>>developing applications, especially for issues like scaling and efficiency. 
>>For instance, when working with polynomials, Linked Lists provide a great 
>>interface to access and edit them.
>
>	What does having links gain you that you don't get from a regular list
>with slicing?

Well, in a larger context you can keep a reference to an element deep in the 
list, and insert a new element in O(1) time at that point.

The usualy argument against providing linked lists and other basic graph 
related functions in the stdlib is that there are in practice many many 
decisions one can make about exactly what kind of implementation specifics one 
might like in such a thing, and what methods to present for use with the thing.

On the flip side, implementing a simple linked list in a specific context is 
pretty trivial as Chris has demonstrated. I do take the point that a 
preexisting (and hopefully debugged) class would obviate a testing burden for 
users. Provided the class provided enough. If it didn't the end user is back to 
replacing or extending it, and having to test anyway.

To the OP: have you looked in PyPI and found no graph classes?

Cheers,
Cameron Simpson <cs@zip.com.au>

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: PEP Request: Advanced Data Structures cs@zip.com.au - 2016-07-17 10:54 +1000

csiph-web