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
How many null values are allowed in a set?
write an algorithm to show the procedure of insertion into a b-tree?
Can we define the size of arraylist?
Why is data structure used?
What is the space complexity of bubble sort?
Why is null not allowed in concurrenthashmap?
Which is better hashmap or hashtable?
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).
Differentiate linear from a nonlinear data structure?
If you are given a choice to use either arraylist and linkedlist, which one would you use and why?
Explain the common uses of tree database.
What is harvesting in agriculture?
How many types of linked list exist?
What are the types of algorithms?
Write the algorithm for converting infix expression to postfix expression?