know the personalities
hold your mouse,move left and right

DataStructure-Program to add a new node at the end of linked list using recursion.


job detailsFree Publishing of valuable information(s) in our website-Procedure to submit detailsjob details

Free Publishing of your College/University function details


Free Publishing of Your College/University function details in our website.Please send details to following email ids


technicalsymposium@gmail.com.
technicalsymposium@in.com.
technicalsymposium@yahoo.com.
technicalsymposium@hotmail.com.
Google Groups

Get Free E-Mail Alerts Daily

Get Daily Job/EntranceExam/Scholarships/
Admission/Competitive Exam Details Symposium/Conference Alerts in your email

Please Enter your email id and go to your inbox and confirm.You will be a member in our group.

Email:
Visit this group

Freshers Jobs/Symposium/Conference/Certification &Education News Given Below-Get Now

Freshers Jobs and IT /Govt Jobs

Symposium and Conference Details

Free Lecture Notes

Free Placement Papers

Free Project Codings


                

DataStructure-Program to add a new node at the end of linked list using recursion.

#include <stdio.h>
#include <conio.h>
#include <alloc.h>
struct node
{
int data ;
struct node *link ;
} ;
void addatend ( struct node **, int ) ;
void display ( struct node * ) ;
void main( )
{
struct node *p ;
p = NULL ;
addatend ( &p, 1 ) ;
addatend ( &p, 2 ) ;
addatend ( &p, 3 ) ;
addatend ( &p, 4 ) ;
addatend ( &p, 5 ) ;
addatend ( &p, 6 ) ;
addatend ( &p, 10 ) ;
clrscr( ) ;
display ( p ) ;
}
/* adds a new node at the end of the linked list */
void addatend ( struct node **s, int num )
{
if ( *s == NULL )
{
*s = malloc ( sizeof ( struct node ) ) ;
( *s ) -> data = num ;
( *s ) -> link = NULL ;
}
else
addatend ( &( ( *s ) -> link ), num ) ;
}
/* displays the contents of the linked list */
void display ( struct node *q )
{
printf ( "\n" ) ;
/* traverse the entire linked list */
while ( q != NULL )
{
printf ( "%d ", q -> data ) ;
q = q -> link ;
}
}

Hosting by Yahoo!

About-Us    Contact-Us    Site-map

©copyright 2009 All rights are reserved to technicalsymposium.com