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
Relative Humidity (RH) is mostly used word in Datacenters, What are the defendents of RH
What are the inspection and test plan for lift materials?
Whats the difference between following two array declaration in JAVA? int a[]={1,2,3,4,5}; int []a-{1,2,3,4,5};
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.
model question papers of GrayOrange company
send me e-mail on dell tech question papers 2011 -2012
what is the number of water, sand and cement required for moulding brick?
What is the use of SUN Server
I want the syllabus of Section Enginner(Signal & Telecom) of RRB Exam
how to join two table those stored on different database.
Anyone have thesis paper about "Electrical Load Forecasting" . Or the web addresses where people usually upload their thesis paper except IEEE.
which topics are come from quizs
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)?
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
what are the differences between malloc() and calloc() in c language?