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

what are the various login options used in loadrunner tool to make a application performance testing

1560


what are nanoemulsions and how are they prepared? i want a brief outline about nanoemulsions.. is anyone of you is having any literature, can you share that? also any an idea where i can get the information?

1741


Is printf(?%d?,p); valid?

1756


when air is supplied from larger diameter pipe with some pressure if change diameter to small pipe the pressure increases or not? also what is increased pressureor velocity?

1541


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.

2450


hi i am an CSE engg student and i cleared the PE exam of BEL 2012 both 24/07/012 and 01/08/2012 , so please if someone can help me with PE Interview question or subject or topics which i should cover that help me clear both Interview.PLZ help. my mail id is rjjkumar99@gmail.com

1850


WHAT IS DIFFERENCE BETWEEN ART & VECTOR QUANTISATION BASED ON THEIR APPLICATION IN NEURAL NETWORK

1526


explain overloaded constrator © constractor

1864


Given two strings, find the sub-string of the first string having minimum length which is having all the characters in second string

1845


question no. 4======Give a brief description of the following terms: a) Play head b) Symbol c) Tweening d) ActionScript e) Frame rate f) Library panel g) Masking h) Context – sensitive Property Inspector i) Bandwidth Profiler j) Frame Label

1662


write program which accept information about 5 student & display same information according to ascending order of their name??

2572


/bin/bash is missing.

1628


Tell me about a time when you had too many things to do and you were required to prioritize your tasks

1618


what two ways you can use to ensure that visual basic does not allow uncleared variables?

1988


Net app interview questions ============================ . Storage Fundamentals: - what is Raid? What are different kind of Raids? - Difference between all of Raids , Advantage of one raid over other - What are FCP & ISCSI, Difference between them. - FC Topologies, Iscsi commands - How to mount a Lun on Windows/Linux - NFS and CIFS - Difference between SAN, NAS and DAS - Different Backup methodologies, Snapshot, mirror, Disaster Recovery, High Availability, Cluster concepts 2. Network Fundamentals: - TCP/IP and ISO/OSI layers - What is DHCP, DNS, SNMP, Router, Hub, Switch, HTTPS , HTTP, telnet , ssh, rsh - Different SNMP versions (V1, V2, V3) - SNMP traps - Ipv4 and Ipv6 addressing 3. Database: - SQL queries, Joins (may ask you to write queries with complex joins) - Aggregate functions - Schemas, Tables, views (create, delete, alter, drop etc) 4. Testing - Bug tracking process, Types of Bugs - Difference between priority and Severity of Bug - Your best bug , what will you do when your bug is not fixed/rejected etc. - What is Functionality/Sanity/Stress/Upgrade & revert/Performance/negative/Release test/regression tests. How you have done these in your past projects. - Black box testing, grey box testing - May ask to write test cases on a given scenario - What is test plan and test summary/strategy document. Different sections in these documents. - SDLC, Test Lifecycle and approach to test a product (Given a product what different kind of testing you will do) 5. Perl ( in addition, you may be asked to write scripts on below areas) - Regular expressions - File/Directory Handling - Scalars, Arrays and Hashes - Packages and Modules - Use and require statements - Go through Net::Telnet, Net::SNMP, Net::SSH modules in perl

2791