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
what is the differance between a technology and an engineering ?
what is the difference between public static void main (String args[]) and static public void main(String args[]) in java?
No. of rounds: 1. GD 2. Written test 3. Technical round 4. HR Group Discussion: In GD I got topic “Effect of Movies on Youth, is it good or bad?”. Everyone got chance to speak. They examined the fluency and point of view on topic. I was selected in this round. Written Test: In written, there were 30 to 40 question including 5 subjective, they are, 1 What is RTTI(Run Time Type Information)? 2 What is containership? 3 What is the difference between compiler level of C++, C# and one other language? 4 Why C++ reserve 2 bytes for structure? 5 One question was related to dot net….. Remaining question are objective and they are belongs to C, Data Structure, 4-5 question from Java and also some questions from Software Development, includes, Some programs given with there output, questions related to sorting algorithm and there complexities, from java, multithreading and a program for Concatenation of two strings using inbuilt methods, from Software development they ask about software lifecycle(including all phases), specification and testing. It was all technical and I cleared the written too. Technical round: In this round, they asked about my resume. Remember the things that you write only those things in resume, in which you are very well, else it will create problems for you. They asked first about myself, and then about my programming skills. They give me a problem to solve in C. They ask me about SQL commands (because I mentioned in resume) like difference between delete and truncate, left join with syntax, then some questions from OS and computer network. I also found out that they were taking my stress testing. They fired questions very rapidly. Don’t give up they will make you feel free environment if you will get nervous (at that time I was). HR round: In this round as usual they asked about personal question to starting with about yourself. They asked some IQ questions like which object with four points are at equidistance, draw three co-centric circle without pull-up your hand, they also asked question, if a bear is jump from 1 meter in …sec. what is the color of that bear. Answer is related to measuring gravity according to south and north pole, and I was confused at that time. They also asked the meaning of my name, I gave that answer.
which topics are come from quizs
how many clusters are generated by k-means algorithm?
what is difference between server 2008R1 and 2008 server R2?
Hi my dears I have 2 questions. 1- how many types of test are there at all? 2- how can I define test characteristics (such as test duration and parameter severity)in developing a modern technological equipment? I tanks you for introducing or sending a text handbook or guidebook file for me. thanks for your coming answers. yours sincerely
hi, i applied for AIRPORTS AUTHORITY OF INDIA for the post of AIR TRAFFIC CONTROLLER(ATC)..so plz send me the sample questions to my id...88arun@gmail.com
what is the definition(body) of a default constructor in c++?
what is the heat insulation material is adaptable for a flue gas duct that carries waste heat from brick kiln to brick drier and what temperature is required to maintain at the tunnel to dry adobe bricks adequately
what is the difference between embedded system and PLC. Whether the micro controller accept future expansion of program?
the controller valve fisher error: travel ??? not output input ok
explain in detail about life cycle of thread
explain bug tracking system in detail.
WHAT HAPPEN WHEN ANY SPINDLE RUN OVER 10 MM HEIGHT ABOVE BOLSTAR IN RING SPINNING FRAME