Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Implement a function that returns the 5th element from the
end in a singly linked list of integers in one pass.

Answer Posted / vignesh1988i

let us assume that we have created a linked lists ..... the
no. of nodes is say 15.
count=15;
printf("enter the node do you wann to look out :\n");
scanf("%d",&i);
if(i>count || i>=0)
printf("no node exists like this \n");
else
{
i=count-i;
view_node(i);
printf("%d",HEAD1->data);
}
getch();
}
void view_node(int i)
{
HEAD1=HEAD;
for(int k=1;k<i;k++)
HEAD1=->HEAD1->ptr;
}

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe how arrays can be passed to a user defined function

1300


Can you please explain the difference between syntax vs logical error?

1199


Can a function argument have default value?

1161


Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?

2583


What is methods in c?

1104


How can you find the exact size of a data type in c?

1005


Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

1227


Explain a pre-processor and its advantages.

1143


What are conditional operators in C?

1106


What do you mean by Recursion Function?

1130


How can my program discover the complete pathname to the executable from which it was invoked?

1081


What is bubble sort in c?

1058


Why we write conio h in c?

1042


How can I send mail from within a c program?

1037


Explain how do you sort filenames in a directory?

1043