GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Placement Papers  >  Microsoft
Go To First  |  Previous Question  |  Next Question 
 Microsoft  |  Question 11 of 14    Print  
Given two sorted single linked lists list1,list2 write a algorithm to merge the two lists again in sorted order. No new nodes should be created.
- Also give all the test cases for testing this algorithm

  
Total Answers and Comments: 1 Last Update: December 18, 2006     Asked by: reddymjr 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
December 18, 2006 02:15:45   #1  
brave        

RE: Given two sorted single linked lists list1,list2 w...

L1= Array (1,3,7,9,11) ; L2 = Array (2,4,6,8,12,14);L3 = Array();

i=0;j=0;k=0;

while ( !(EOF(L1)) && !(EOF(L2)))

{

if L1[i]<L2[j] {L3[k] = L1[i];i++;}

else {L3[k]=L2[j];j++;}

k++;

}

for (i=0;i<=k;i++)

print_r(L3[i]);


 
Is this answer useful? Yes | No

 Related Questions

Computer Architecture1. Explain what is DMA? 2. What is pipelining? 3. What are superscalar machines and vliw machines? 4. What is cache? 5. What is cache coherency and how is it eliminated? 6. What is 
View Question | Asked by : Beena

Databases* 1. You, a designer want to measure disk traffic i.e. get a histogram showing the relative frequency of I/O/second for each disk block. The buffer pool has b buffers and uses LRU replacement 
View Question | Asked by : Beena

Java1. How do you find the size of a java object (not the primitive type) ? ANS. type cast it to string and find its s.length() 2. Why is multiple inheritance not provided in Java? 3. Thread t = new Thread(); 
Latest Answer : . Why is multiple inheritance not provided in Java? 3. Thread t = new Thread(); t.start(); t = null; now what will happen to the created thread? 4. How is garbage collection done in java? 5. How do you write a "ping" routine in java? 6. What are the security ...
Read Answers (1) | Asked by : Beena

1. How do you use RSA for both authentication and secrecy?2. What is ARP and how does it work?3. What's the difference between a switch and a router?4. Name some routing protocols? (RIP,OSPF etc..)5. 
Latest Answer : What is ARP and how does it work?Defination:ARP (Address Resolution Protocol) is a protocol for mapping link layer addresses to a physical machine address that is recognized in the local networkWorking:When a host wants to send a packet with to a known ...
Read Answers (1) | Asked by : Beena

Algorithms and Programming1. Given a rectangular (cuboidal for the puritans) cake with a rectangular piece removed (any size or orientation), how would you cut the remainder of the cake into two equal 
Latest Answer : 1) Slice the cake horizontally in mid height. ...
Read Answers (14) | Asked by : Beena

PersonalityIt is best to read some website or a book for questions like these. 1. Tell me the courses you liked and why did you like them. 2. Give an instance in your life in which you were faced with 
Latest Answer : I think you should know all development and research centers across the globe. Like I dint know there is one research center in Beijing. During Lunch interview I was asked how much did I know about microsoft work and their centers. I told them about cambridge, ...
Read Answers (1) | Asked by : Beena

Puzzles, Riddles and Others0. Classic: If a bear walks one mile south, turns left and walks one mile to the east and then turns left again and walks one mile north and arrives at its original position, 
Latest Answer : WRONG !probability n that case will be = 1/2(1) + 1/2( 49/99) ...
Read Answers (13) | Asked by : Beena

1) Currently computers use 2 bits as we know, 0 and 1. What do you think would have happened if we had a thrid bit?2) An AI based computer tic-tac-toe game situation is represented below. Given the following rules in order, who do you think will win. a) If I can win, I will b) If I have to block, I will o ----|---|---- o o x ----|---|---- x xP.S : The computer is playing against itself. Justify your answer with an explanation.
Read Answers (2) | Asked by : javaawk

1)Given two sorted linked lists list1,list2. Combine the two list into a new sorted list with our creating new nodes.-All give the test case for testing the same2)You have to count the occurances of all words in a document. You are given a method chat * GetNextWord, that returns the next word from the document.- Which datastructure can be userd to achieve this- Write a algorithm for the same- What is the order of the above algorithm
Read Answers (3) | Asked by : Jyotsna

Given two sorted single linked lists list1,list2 write a algorithm to merge the two lists again in sorted order. No new nodes should be created.- Also give all the test cases for testing this algorithm
Read Answers (1) | Asked by : reddymjr


 Sponsored Links

 
Related Articles

ODP.NET - Populating a Dataset with a Single Data Table

ODP NET Populating a Dataset with a Single Data Table A dataset is simply a group of data tables These data tables can be identified with their own unique names within a dataset You can also add relations between data tables available in a dataset mosgoogle The following code gives you the details o
 

ODP.NET - Retrieving a Single Row of Information Using OracleDataAdapter

ODP NET Retrieving a Single Row of Information Using OracleDataAdapter In the previous example we worked with a set of rows in the DataTable object Now we shall work with a particular row using the DataTable object The following code accepts an employee number from the user and gives you the details
 

ERP Success cases

ERP Success cases You have probably heard a lot about ERP systems especially about their implementation and its advantages and disadvantages Here you will find that there are no unachievable targets and that every effort brings benefits These are the stories of people who found success through ERP i
 

Testing and Integration

Once the software is complete, it will go though rigorous testing before its actual integration.&nbsp; In this article we will take a look at different types of software testing and also different types of integration. With the diversity of business setting and software development models, it al
 

Client-Server Testing Technology

Client Server Testing Technology Client Server Software Client server software requires specific forms of testing to prevent or predict catastrophic errors Servers go down records lock I O Input Output errors and lost messages can really cut into the benefits of adopting this network technology Test
 

Software Testing Myths

Software Testing Myths Any IT professional is sure to know the different phases of the Software Development Life Cycle or SDLC namely Feasibility Study Requirement Analysis Design Construction or Coding Testing Implementation Maintenance Support the activities carried out in each phase their sig
 

Types and Levels of Testing in Programming

Types and Levels of Testing in Programming Testing is an important step in software development life cycle The process of testing takes place at various stages of development in programming This is a vital step in development life cycle because the process of testing helps to identify the mistakes a
 

How To Write The Main Heading For Your Essay

How To Write The Main Heading For Your Essay When you write an essay you will want to make sure you write a good heading To write a good heading you will need to plan your essay very effectively If you remember any good points from lectures these could be things you may want to use to create a good
 

How To Write a Good Essay

How To Write a Good Essay While there are many different methods you can use to write an essay standard essays will follow specific formats Understanding the basic format of an essay will allow you to write informative articles which will capture the attention of those that read it mosgoogle The fir
 

How To Write A College Essay

How To Write A College Essay The best way to write a college essay is to start by brainstorming ideas You will also want to make a list of topics you re interested in While there are other ways you can write a college level essay this method is the easiest mosgoogle When you brainstorm you will want
 

Related Categories
Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape