Jump to content

Talk:Doubly-linked list/Definition: Difference between revisions

Line 17:
What does it mean "The structure should not allow circular loops"? To me, it's the design of data structure, which should support that; however, I seem to see in the some examples that it's the attached code which takes care about that.
: I also want to know. Is this requirement intended to rule out circular implementations of the doubly linked lists which use a "sentinel node" to eliminate corner cases? [[User:Kazinator|Kazinator]] ([[User talk:Kazinator|talk]]) 03:34, 16 October 2016 (UTC)
: Note also that a doubly-linked list is inherently circular. Between every node and its predecessor, if it has one, there is a circular relationship: the node points to its predecessor and its predecessor points to the node. That is a reference cycle. Ergo, this task description is flawed: a doubly-linked list without "circular loops" is a direct contradiction. Maybe the intent is to say the operations on the list must check for corruption? Such that if a node is to be added to a doubly-linked list, the operation must fail/assert/throw if node is already entangled in a doubly linked list? [[User:Kazinator|Kazinator]] ([[User talk:Kazinator|talk]]) 15:33, 16 October 2016 (UTC)
 
And the code itself, by the way, isn't required by this task, though it would clearly be useful to have data structures together with associated code for working with them. Should we update the task definition (and possibly make existing examples invalid)?[[User:Avmich|Avmich]] 01:36, 12 November 2009 (UTC)
543

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.