EmbLogic's Blog

Code to demonstrate how to create a copy of a single linked list in C.

RCS file: copy_linked_list.c,v
Working file: copy_linked_list.c
head: 1.14
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 14;    selected revisions: 14
description:
Code to demonstrate how to copy an already existing linked list.
—————————-
revision 1.14
date: 2014/02/15 01:32:47;  author: root;  state: Exp;  lines: +15 -2
Status:Copy of a linked list is created successfully.
Previously there was a small bug which was discovered and fixed by including several checks.
—————————-
revision 1.13
date: 2014/02/15 01:23:04;  author: root;  state: Exp;  lines: +7 -2
Logical error fixed.
—————————-
revision 1.12
date: 2014/02/15 01:17:35;  author: root;  state: Exp;  lines: +5 -4
Prototype of the copy_linked_list() function is changed to return the starting address of the new copy of the linked list.
Creating a new function to display the neewly created linked list.
—————————-
revision 1.11
date: 2014/02/15 01:15:00;  author: root;  state: Exp;  lines: +37 -1
copy_linked_list() function is implemented.
Checking…….
—————————-
revision 1.10
date: 2014/02/14 17:49:17;  author: root;  state: Exp;  lines: +1 -0
Logical error fixed.
Issue:The value of temp was not updated.
—————————-
revision 1.9
date: 2014/02/14 17:47:07;  author: root;  state: Exp;  lines: +11 -2
display_list() function is implemented inside the program.
An extra value is getting displayed.
Checking…..
—————————-
revision 1.8
date: 2014/02/14 17:38:08;  author: root;  state: Exp;  lines: +1 -0
Segmentation fault ocurred while running the program because after allocating a node the starting address of it is not returned to the main function.
Logical error fixed.
—————————-
revision 1.7
date: 2014/02/14 17:26:50;  author: root;  state: Exp;  lines: +37 -1
create_node function is implemented inside main() to insert the nodes in the linked list.
Checking….
—————————-
revision 1.6
date: 2014/02/14 17:05:57;  author: root;  state: Exp;  lines: +17 -1
create_list() function is called that will create the start node in the linked list inside which no value is stored.
Prototype of the create_list() function is declared.
Checking….
—————————-
revision 1.5
date: 2014/02/14 16:57:46;  author: root;  state: Exp;  lines: +1 -0
Header file:<stdlib.h> is included to support exit() function.
—————————-
revision 1.4
date: 2014/02/14 16:55:28;  author: root;  state: Exp;  lines: +20 -0
exit() function is included in the main program in case the user wants to end the program.
—————————-
revision 1.3
date: 2014/02/14 16:46:37;  author: root;  state: Exp;  lines: +12 -0
A Main menu is prepared to provide the user with the available options.
Checking…
—————————-
revision 1.2
date: 2014/02/14 16:40:16;  author: root;  state: Exp;  lines: +6 -0
A structure is defined of type node.Two pointers of type struct node are declared inside main().
—————————-
revision 1.1
date: 2014/02/14 16:38:17;  author: root;  state: Exp;
Initial revision
=============================================================================

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>