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

Which data structure is used to perform recursion?

941


What is hashing technique?

895


Can you please explain the difference between array_name and &array_name?

947


What is the difference between a Stack and a Queue.

908


Explain heapsort. What is its complexity?

927


Which is faster array or list?

871


How to do the intersection of two sorted arrays?

980


If you have to store one lakh objects, what will be a better option- a hash map or an array list?

1164


Can we null keys in treemap?

962


What is precision in data structures?

1055


Differentiate linear from a nonlinear data structure?

1004


Does concat mutate array?

875


What is the difference between an array and vector?

979


What is the use of substring?

891


What are the advantages of array?

856