Amazon Interview Question: Given a binary tree, convert ... | Glassdoor

Interview Question

Software Development Engineer Interview Seattle, WA

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.
Tags:
binary tree linked list
Answer

Interview Answer

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.

Interview Candidate on Jun 18, 2012
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 Feb 17, 2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.