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...

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

Answer Posted / bhanu yadav

reverse(node *first) //first address of first node in linked
{ node *x,*temp,*ttemp;
temp=first; //temp at first
ttemp=temp->next; //ttemp next to temp

while(temp->next!=null)
{ x=ttemp->next;
ttemp->next=temp;
temp=ttemp;
ttemp=x;
}
}

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a simple path?

990


Why sorting is used?

938


Can a binary tree be empty?

931


What is the complexity of sorting algorithm?

887


What is doubly linked list in data structure?

824


What are the different types of data structures?

1028


Define depth and height of a node?

919


If we try to add duplicate key to the hashmap, what will happen?

870


What is the meaning of arraylist?

943


What is the difference between array list and vector list?

905


What are linked lists most commonly used for?

897


What is dynamic array how is it created?

885


Explain about map and their types?

1013


Define separate chaining?

959


What do you mean by 2-3-4 tree?

994