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

Relative Humidity (RH) is mostly used word in Datacenters, What are the defendents of RH

1682


What are the inspection and test plan for lift materials?

1972


Whats the difference between following two array declaration in JAVA? int a[]={1,2,3,4,5}; int []a-{1,2,3,4,5};

2548


What is the allowable load carrying capacity of a circular column section of 400 mm diameter reinforced with 6x25 mm diameter bars adequately tied with spirals? Consider concrete of grade M25 and steel of grade Fe 415.

2324


model question papers of GrayOrange company

1350


send me e-mail on dell tech question papers 2011 -2012

1800


what is the number of water, sand and cement required for moulding brick?

1338


What is the use of SUN Server

1972


I want the syllabus of Section Enginner(Signal & Telecom) of RRB Exam

2785


how to join two table those stored on different database.

1883


Anyone have thesis paper about "Electrical Load Forecasting" . Or the web addresses where people usually upload their thesis paper except IEEE.

1822


which topics are come from quizs

1563


what is Pick map and what is the use of it? I want to configure a MVG applet on a filed in opportunity form applet. and when i select fields from MVG , it should reflect on the form applet(means there should be changes on fields in MVG according to Field select from MVG appler). Is this possible (with MVG or Picklist)?

2043


Hi all, Pls find the bellow mentioned interview questions related to hp-unix. 1. Job Scheduling; mainly crontab, at, batch command 2. Backup stetegy; incremental, full system back up; diff between tar & ufsdump 3. diff between hard link & softlink 4. How to list only the directories inside a directory (Ans. ls -l|grep "^d") 5. RAID levels; pros & cons of diffrent levels; what is RAID 1+0 6. How to recover a system whose root password has lost? 7. What is a daemon? 8. How to put a job in background & bring it to foreground? 9. What is default permissions for others in a file? 10. Questions on shell initialization scripts? 11. Questions on restricted shell 12. What is diff betwn grep & find? 13. What is egrep? 14. Questions on shell programming 15. What is a pipe? 16. Questions on Solaris patch management like pkgadd etc Thnaks & Regards Biswanath Das Email ID:biswanath_das84@yahoo.com

2333


what are the differences between malloc() and calloc() in c language?

2396