linked list

Linked List
In this program, you will implement a number of functions:
1. Insertion of a node to a linked list, by given criteria
2. Deletion of a node on a linked list, by given criteria
3. Search a node on a linked list, by given criteria
Node structure:
Info Field: Name (only one string, for simplicity)
Score (an integer)
Link: a pointer
1. Insertion criteria:
a. The linked list insertion is based on alphabetical order of the given names.
b. If a node on the list has the same name as the one that is to be inserted, then the
existing one is deleted and the new one is inserted.
2. Deletion criterion
For a given name from a3.txt, delete that name associated node from the linked list.
3. Search criteria:
a. For a given name, search on the linked list if there is a node that has this name.
b. If found, print out the node info: Name and Score. One single line for each
searched node.
c. If not found, print out “not found”.
d. The search process cannot change any info or node on the list.
The program reads from a3.txt for actions (insertion, deletion, or search):
%SEARCH, %INSERT, %DELETE, %PRINT, %END
The “PRINT” command directs the program to print out information in each and every node
on the linked list, from the first node to the last. The “END” command ends the program
running, but not closing the window.


below is the file
%INSERT
MARK 29
DAVID 21
JOHN 44
JOHN 51
LARRY 39
MARK 21
DAVID 18
JOHN 28
MARK 35
DONALD 41
PHIL 26
%PRINT
%DELETE
MARK
DAVID
%PRINT
%SEARCH
JONE
DAVID
LARRY
%INSERT
LARRY 13
GARY 15
GARY 42
%PRINT
%INSERT
TERRY 23
%DELETE
GARFIELD
%SEARCH
PHIL
%PRINT
%END


Last edited on
The list below is from a note pad file...saved as a3.txt.

i 'm having problems with this, can some one help
Topic archived. No new replies allowed.