![]() |
|
#1
|
|||
|
|||
Ineed some help with thos code - Linear Linked ListCPP / C++ / C Code:
I should modify this header file list.h above and replace the typedef line with -> CPP / C++ / C Code:
I have to write a function creat_list() to transform an array of type DATA to a linear linked list. Then write another funtion that counts the number of people abpove both a given aga and weight. I have read the chapter on linear linked list, but I still dont know how to start this problem. Can some help me with this? Last edited by LuciWiz : 09-Nov-2004 at 04:29.
Reason: Please insert your c code between [c] & [/c] tags
|
|||
|
#2
|
|||
|
|||
|
can't really give you code.. because i do't have any.. but i have done this in java...
have a method called insert or something in your linked list. with this, just add an element to your link list.. ie add a node. your contructor for the linked list should create an empty list. in your method to transfer data from the array to the list, just insert till the end of the array.. i'm not sure if i understand your problem correctly.. but if i do, it shouldn't be too hard to do! assignment from school? ps. why are you using structs? i recommend using classes for this.. its much easier and neater... i think anyways.. i guess i have used classes more... |
|
#3
|
|||
|
|||
Thank YouWhats The Difference Between Java And C? Yes This Is A Class Assignment,and I Dont Really Understand This Topic Of Linked Lists. Thats Why I Am Here Seeking Help.
Sosy2001 |
|
#4
|
|||
|
|||
|
Hi,
Pls see post http://www.gidforums.com/t-3759.html It will give you some idea about building a linked list. Thanks, |
|
#5
|
||||
|
||||
|
Quote:
__________________
The 3 Laws of the Procrastination Society: 1) Never do today that which can be put off until tomorrow 2) Tomorrow never comes |
|
#6
|
|||
|
|||
|
i know i know.. was a student myself just a couple of months ago!
i tried looking for my old java implementation so you could check it out.. but it seems to have got deleted. but, i can point you to a first year computer science website where you might find something useful. http://www.site.uottawa.ca/~turcotte/teaching/csi-1101/ check out the solutions to assignment 8. that course used to be in java when i took it. but it might have changed. |
|
#7
|
|||
|
|||
|
actually, i was looking and i found this code in java for a linked list.. might help you out.
JAVA Code:
You will find that on the same website if you click on lecture notes, then source code, then 03/ |
Recent GIDBlog
Install Adobe Flash - Without Administrator Rights by LocalTech
| 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 |
| bus error in linked list | picknicker187 | C Programming Language | 2 | 08-Oct-2004 10:44 |
| Insert problem in linked list with two function code | Kay Chan | C++ Forum | 1 | 03-Sep-2004 09:52 |
| help on linked lists any1????? | nick4 | C Programming Language | 1 | 17-May-2004 09:32 |
| [include] list1.h -- Linked list class | dsmith | C Programming Language | 2 | 04-May-2004 09:42 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The