Write a nonrecursive routine to reverse a singly linked
list in O(N) time.
Answer Posted / sandeep
node * reverse(node * list)
{
node *p, *q, *r;
p = list;
q = p->next;
while(q->next != NULL)
{
q = p->next;
r = q->next;
p->next = r;
q->next = p;
p = p->next;
}
q->next = p;
p->next = NULL;
return q`;
}
Is This Answer Correct ? | 26 Yes | 7 No |
Post New Answer View All Answers
Write a test case plan for a typical banking application which involves functionalities like Balance enquiry, deposit, fund transfer etc. Make your assumptions and mention the same in your answer sheet.
how to convert postfix notation into prefix in data structures. please send me algo of taha
what are basic step involved in embedded system software development?
hi friends.... i want do telecom course, iam getting confused. plz tell me courses and levels in that field. iam fresher B.E ECE student. and plz tell institutes in hydrabad or bangalure.
if we give you the job AS A PETROLEUM ENGINEER WHAT WILL YOU DO(that is extraordinary) for our company
Hi i want some previous interview questions and answers for KVB Bank.
A rectangular sheet dimensions a x b is to be made into an open-topped box by cutting a square of side h from each corner and folding the 4 sides up. Find the value of h which allows the maximum volume of the box?
Is there any difference between the concepts of encoding,decoding and encryption and decryption?
WAP in Java to print the format AMIT M I T
PLEASE SEND ME NIC SCIENTIFIC OFFICER-2009 EXAM PATTERN AND QUESTION PAPERS
what is the different between view and materialized view in oracle DBA?
Please explain me gsm call scenario for a prepaid roamer calling to a prepaid roamer?
why view is created in database
why every computer should have a boot strap routine?
reverse a number ( like 1234 into 4321) using malloc in C programming