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

How efficient is binary search?

916


State the difference between primitive and non-primitive data types?

1213


What is data structure definition?

928


What is meant by int?

1055


What is bubble sort algorithm in data structure sort and searching?

949


How do you declare An array of three char pointers

1106


What is time complexity of binary search?

955


Why do we need arrays if all the operations that are performed on arrays can be performed on arraylist?

909


Can we sort hashmap?

938


What is meant by balanced binary tree?

931


What is data structures in computer science?

967


What is difference between hashmap and hashtable?

1016


How do stacks work?

977


Calculate the address of a random element present in a 2d array, given base address as ba.

1580


Explain about map and their types?

1061