![]() |
|
#1
|
||||
|
||||
[Include] list1.h -- Linked list classGID Forums C/C++ Forums Code Submittal Form Name/Brief Description: Singly-linked listDate of Original Submission: February 7, 2004Submitted by: dsmithLicense: None - there is nothing ground breaking hereDetailed Description: I have posted this previously in a reply, but I wanted to explain it a little more. This is an extremely small and simple singly-linked list routine. It is written entirely as an inline function, so there is no external libraries to call. It is less than 200 lines with comments. This may seem like really simple or redundant code, but almost every project that I do includes this file. In real world programs, the amount of your data is rarely known, so a dynamic storage solution is crucial. With this routine, I am confident that errors are not being caused by my storage code. I have written a tiny example showing the use of the common functions. This may seem like a simple thing where an array would be easier to use, but what size is that array going to be? Also, typecasting can be confusing, but in reality I can make a list that contains any type of data all in the same list.Problems/Limitations:
Last edited by dsmith : 04-May-2004 at 09:43.
|
|
#2
|
||||
|
||||
|
I have done several updates to my linked list implementation.
I have reposted this file. Again comments or questions are encouraged. Last edited by dsmith : 04-May-2004 at 09:42.
|
|
#3
|
||||
|
||||
|
Okay, in testing my linked list with a data structure test, I found a major flaw in my logic that was extremely inefficient in the placing of a lot of data into the list. By removing one line of this code, I fixed that inefficiency. I have posted this new implementation. (I also deleted the old ones, since I notice that people have been downloading my old implementation).
|
Recent GIDBlog
More photos on Flickr by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Merge sort on a linked list | Temujin_12 | C++ Forum | 1 | 06-Mar-2008 20:33 |
| need help to define a class in C++ | yannoush | C++ Forum | 7 | 09-Sep-2003 00:28 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The