🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: att.lang.c++
Article #179

HELP c++ linked list

#179
From: A Mohap
Date: Sun, 11 Apr 1999 00:00
25 lines
1370 bytes
I am trying to make a kind of linked list in c++. The linked list will
maintain sorted doubles. This would look something like this:

struct Node {
 double data;
 Node *next;
};

This is easy to do BUT in addition to this my linked list has to maintain
two orders: one taking sign into consideration and another that doesn't care
about the sign. So I think the data structure for this looks like this:

struct Node {
 double data;
 Node *nextSigned,*nextUnsigned;
};

I have successfully linked all the elements that take sign into account by
using an add function that appends the data in order. but how do i link the
unsigned parts together?

Example:
If the data was -2,5,3,-1
sorted list1: -2,-1,3,5  ---> I've done this successfuly
sorted list2: -1,-2,3,5  ---> HOW TO DO ThIS LIST?
Technical Details
Message-ID: <7eqr0t$9kc$1@autumn.news.rcn.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d4ba,124e714fc7dab6d9,start
X-Google-Attributes: gid10d4ba,public
From: "A Mohap" <amol_moh@hotmail.com>
Subject: HELP c++ linked list
Date: 1999/04/11
Message-ID: <7eqr0t$9kc$1@autumn.news.rcn.net>
X-Deja-AN: 465186189
X-Trace: ybltmV7YyM9tgif5uC3EtnB7YhC3q6ULv5ggBNWRUMFJns5Cp9TVjA==
X-Priority: 3
X-MSMail-Priority: Normal
NNTP-Posting-Date: 11 Apr 1999 18:52:13 GMT
Newsgroups: att.lang.c++
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
X-Complaints-To: abuse@rcn.com