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

Answer Posted / sanjay rajput

struct node
{
int val;
struct node *next;
};

typedef struct node NODE;
NODE *p,*start;
p=start->next;
while(p!=NULL)
{
p->next=start;
start=p;
p=p->next;
}

Is This Answer Correct ?    1 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Give a basic algorithm for searching a binary search tree?

574


What are lists?

614


Explain binary representation?

558


What is impact of signed numbers on the memory?

592


What is sort order?

564






Is quicksort a stable algorithm?

606


What is the difference between a stack and an array?

645


What do you mean by the term “percolate up”?

617


What are the advantages of sorting and filtering data?

582


Describe the types of data structures?

658


What is an ordered list?

651


Which is faster binary or linear search?

560


If you do not initialize an array what will happen?

671


What is an iterative algorithm?

638


Why it is important to have aligned addresses? What is the exception generated when there is a misaligned address?

594