Interview Question

Software Development Engineer Interview

-Seattle, WA

Amazon

Given a binary tree, convert it into a doubly circular linked list. The structure of the tree was given by the interviewer and also the structure of the doubly circular linked list.

Answer

Interview Answers

2 Answers

1

The elements in the DCLL were in the same order as the inorder traversal of the binary tree. So if you know how to code the inorder traversal of a tree in any language the question won't be that hard.

Anonymous on

0

The following blog discussed how to convert a binary search tree into a double linked list: http://codercareer.blogspot.com/2011/09/interview-question-no-1-binary-search.html

Harry on

Add Answers or Comments

To comment on this, Sign In or Sign Up.