create an singly linked lists and reverse the lists by
interchanging the links and not the data?

Answer Posted / vimesh

struct node
{
int data;
node *link;
};
node *p=NULL;
void reverse(*x)
{
node *r,*s,*q;
r=NULL;
q=x
while(q->link!=NULL)
{
s=r;
r=q;
q=q->link;
r->link=s;
}
x=r;
}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many null values are allowed in a set?

466


write an algorithm to show the procedure of insertion into a b-tree?

526


Can we define the size of arraylist?

481


Why is data structure used?

533


What is the space complexity of bubble sort?

524






Why is null not allowed in concurrenthashmap?

464


Which is better hashmap or hashtable?

474


Now you are given an array of a characters (both ASCII and Kanji) and, an index into the array. The index points to the start of some character. Now you need to write a function to do a backspace (i.e. delete the character before the given index).

545


Differentiate linear from a nonlinear data structure?

546


If you are given a choice to use either arraylist and linkedlist, which one would you use and why?

505


Explain the common uses of tree database.

514


What is harvesting in agriculture?

500


How many types of linked list exist?

536


What are the types of algorithms?

555


Write the algorithm for converting infix expression to postfix expression?

562