VMware Interview Question
145 Interview Reviews |
Back to all VMware Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Senior Member of Technical Staff at VMware:
Merge 2 sorted single-linked lists into the brand new list (no pointer copy allowed). The resulting list should have the data from both lists all correctly sorted.
| Tags: | algorithms See more , See less 8 |
See more for this VMware Senior Member of Technical Staff Interview
Helpful Question?
Yes |
No
Inappropriate?



0 of 0 people found this helpful
by Venona:
2. Check to see if list 1 is NULL - return list 2
3. Check to see if list 2 is NULL - return list 1
4. Both list non-empty:
Pick lowest of first element of list 1 and 2 - put that into head element
Initialize two pointers into the the 2 lists and a pointer into the head of the new list
while there are elements left in either of the two lists
append the lowest of the two elements to the new list using new pointer's next field