EmbLogic's Blog

Program to remove duplicates from a sorted linked list in C language.

RCS file: remove_duplicate_sort.c,v
Working file: remove_duplicate_sort.c
head: 1.9
branch:
locks: strict
root: 1.9
access list:
symbolic names:
keyword substitution: kv
total revisions: 9;    selected revisions: 9
description:
Code to demonstrate how to remove duplicates in a sorted linked list.
—————————-
revision 1.9    locked by: root;
date: 2014/02/16 18:47:38;  author: root;  state: Exp;  lines: +6 -0
Bug fixed.
Issue:After freeing the memory the pointer is not set to NULL,because of which is it is becoming a dangling pointer i.e a pointer that is not pointing to valid memory location.
Status:The program is working absolutely fine i.e it is removing all the duplicates present in the single linked list.
—————————-
revision 1.8
date: 2014/02/16 18:34:46;  author: root;  state: Exp;  lines: +1 -0
Segmentation fault is coming due to illegal access of memory.
Debugging….
—————————-
revision 1.7
date: 2014/02/16 18:30:12;  author: root;  state: Exp;  lines: +1 -2
New line character(\n) is added to make the output of display more readable.
Inside remove_duplicates() function break statement is removed to check the removal of duplicate elements.
—————————-
revision 1.6
date: 2014/02/16 18:25:03;  author: root;  state: Exp;  lines: +23 -0
Logical error fixed.
Issue:The pointer to structure of type struct node is updated before the start pointer is updated.
Extending this code to remove all the duplicates in the linked list.
—————————-
revision 1.5
date: 2014/02/16 17:13:11;  author: root;  state: Exp;  lines: +11 -0
display_nodes() function prototype is given and its functionality is given.
—————————-
revision 1.4
date: 2014/02/16 17:00:00;  author: root;  state: Exp;  lines: +29 -1
Body of the create_node(),create_linked_list() and insert_value() function is added in the code.
Code working correctly……
—————————-
revision 1.3
date: 2014/02/16 16:49:09;  author: root;  state: Exp;  lines: +30 -1
Prototypes of the create_node() and create_linked_list() functions are declared.
Implementing the definitions of these functions…..
—————————-
revision 1.2
date: 2014/02/16 16:10:33;  author: root;  state: Exp;  lines: +17 -0
Header file:<stdlib.h> is included to support exit() function.
A complete layout is prepared telling the user what are the available options.
—————————-
revision 1.1
date: 2014/02/16 16:08:48;  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>