EmbLogic's Blog

Program to delete a node at a specified position and also to delete the entire linked list in C language.

RCS file: delete_n_nodes.c,v
Working file: delete_n_nodes.c
head: 1.11
branch:
locks: strict
root: 1.11
access list:
symbolic names:
keyword substitution: kv
total revisions: 11;    selected revisions: 11
description:
Code to demonstrate how to delete a node at specified position and also how to delete all the nodes in the single linked list.
—————————-
revision 1.11    locked by: root;
date: 2014/02/18 02:32:59;  author: root;  state: Exp;  lines: +16 -6
Logical error fixed.
Issue:double pointer is not used to point to the start node.With the help of this double pointer each node is deleted starting from the start node.

There is a slight modification inside the display function needs to be done because if there is no linked list.The display function must include a check to display an a message to the user that there is no linked list which can be displayed.

Status:delete_all_nodes() function is implemented successfully with delete_node_at_n() position.
—————————-
revision 1.10
date: 2014/02/18 02:24:11;  author: root;  state: Exp;  lines: +1 -0
Prototype of the delete_all_nodes() is declared.
Logical error fixed.
—————————-
revision 1.9
date: 2014/02/18 02:22:09;  author: root;  state: Exp;  lines: +12 -0
A function to delete all the nodes in the single linked list in C is implemented.
Previously the function delete_node_at_n() is implemented and it is working correctly.
—————————-
revision 1.8
date: 2014/02/18 02:14:45;  author: root;  state: Exp;  lines: +25 -2
delete_node_at_n() function is implemented.The dynamically allocated memory is freed using free() function call.
Checking……
—————————-
revision 1.7
date: 2014/02/17 16:51:39;  author: root;  state: Exp;  lines: +2 -1
Logical error fixed.
Issue:The address of the newly created node is node returned to the main function.
—————————-
revision 1.6
date: 2014/02/17 16:49:36;  author: root;  state: Exp;  lines: +2 -2
Logical error fixed.
Issue:start is used instead of temp inside the create_list() and create_node() functions.
—————————-
revision 1.5
date: 2014/02/17 16:48:03;  author: root;  state: Exp;  lines: +11 -0
display_node() function is implemented.
Checking……
—————————-
revision 1.4
date: 2014/02/17 16:41:31;  author: root;  state: Exp;  lines: +32 -0
create_node() function is implemented that inserts a node at the end of a single linked list.
Now defining the display_nodes() function to display the nodes in the linked list.
—————————-
revision 1.3
date: 2014/02/17 16:30:19;  author: root;  state: Exp;  lines: +27 -1
A structure is defined with 2 members:info and pointer to a structure of type struct node.
create_list() function prototype is declared to create the linked list.On error a message will get displayed.
—————————-
revision 1.2
date: 2014/02/17 16:24:22;  author: root;  state: Exp;  lines: +18 -0
Header file:<stdlib.h> is included to support exit() function.
—————————-
revision 1.1
date: 2014/02/17 16:22:33;  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>