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

Write a nonrecursive routine to reverse a singly linked
list in O(N) time.

Answer Posted / hasan ali mirza

list reverse(list L)
{
stack S;
position Lpos = first(L);
while(Lpos->element != NULL)
{
push(Lpos->element, S);
Lpos = Lpos->next;
}
makeEmpty(L);
Lpos = first(L);
while(isempty(S) == FALSE)
{
insert(pop(S), Lpos);
Lpos = Lpos->next;
}
return L;
}

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

why we select you?

2294


what is disadvantages of waterfall model ?? industry used which model ??

1991


Why it is a preferable option in parallelextender development ?

2043


searching a B-tree indexed tree compared to B+ tree is slow..True or false

2313


How will a tester be sure that He’s covered the entire functionality in his Test case and not missed out anything?

1976


Please derive the formula for the area of a circle.

1184


WHAT IS DIFFERENT BETWEEN YOU AND OTHER APPLICANT TO GIVE YOU THE JOB

2214


Can main() function can be made virtual?

2010


WHY WE USE {} AT THE STARTING OF C PROGRAM

2000


T is a tree and V is a vertex of T of maximum degree in T, say the degree of V in n. Prove that T has atleast n vertices of degree 1.

1939


successful command to make linux system as router in redhat-+

2052


i m a student of 4th year ,i m unable to get the embassy appointment dates , and it details.............please help any body.My id=john_searching143@yahoo.com

1896


Just a one miniute topics in English?

1839


Which software model is best suited for the Maintenance kind of project?

2722


how can i write a program in c of SPARCE MATRIX(data structure)?

2129