## Adobe Interview Question Software Engineer in Tests

• 0

You 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

Comment hidden because of low score. Click to expand.
2
of 2 vote

Assume Head node of the circular list contains minimum value

1. 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.

Comment hidden because of low score. Click to expand.
0
of 0 vote

When we merge two lists , we compare the smallest not inserted element of the the two list two decide which will be the new element of the new list. This is done till one gets empty. In this case empty for circular list would mean when iterator becomes equal to head again.

Comment hidden because of low score. Click to expand.
0
of 0 vote

it is same as normal merging of two sorted lists...

Comment hidden because of low score. Click to expand.
0
of 0 vote

it is same as normal merging of two sorted lists...

Comment hidden because of low score. Click to expand.
0
of 0 vote

exactly the program is nothing but the merge function in merge sort algorithm..

Comment hidden because of low score. Click to expand.
0
of 0 vote

a simple merge sort

Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

### Books

is a comprehensive book walking you through every aspect of getting a job at a top tech company, while focuses on software engineering interviews.

### Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.