Adobe Interview Question Software Engineer in Tests
0of 0 votesYou have a sorted circular linked list and a sorted linear linked list. Write a program to merge these two arrays and create a new sorted circular linked list
Country: United States

Assume Head node of the circular list contains minimum value
- nsdxnsk on August 01, 2012 Edit | Flag Reply1. Compare circular.Head.Data to linear.Head.Data, if liniar's Data is smaller, replace circular Head, and move linear's pointer to next.
2. Do 1 until linear.Node.Data > circular.Head.Data
3. Do normal merge sort for those 2 under condition of
while (circular.Node.Next != circular.Node.Head) // If it equals to Head, it means it gets back to Head pointer
4. After the while loop, if still linear pointer is in the middle, insert Nodes at the last of cirsular list.