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

Briefly explain recursive algorithm 50 how do you search for a target key in a linked list?

935


What is difference between hashmap and hashtable?

953


What are binary search and fibonacci search?

949


What is the complexity of adding an element to the heap?

928


Define primary data structures?

970


Is there any difference between int[] a and int a[]?

1152


Can you tell me the differences between Array and ArrayList?

1044


Is a hashset ordered?

982


Draw a binary Tree for the expression : A * B - (C + D) * (P / Q)

1403


what is the difference between singly and doubly linked lists?

964


When would you use a hashmap?

906


How do treesets work internally?

914


How do you sort an array in decreasing order?

835


How does threaded binary tree represented in data structure?

1005


What is difference between tree and binary tree?

970