Author |
Topic: flatten binary search tree into doubly linked list (Read 6081 times) |
|
sanny
Newbie
Posts: 6
|
|
flatten binary search tree into doubly linked list
« on: Dec 3rd, 2008, 1:32am » |
Quote Modify
|
flatten a linked binary search tree into a sorted doubly linked list, without using any extra space. You have to do this by only modifying the pointers, that is your links to leftchild or rightchild in tree beomes your forward or backward pointer in doubly linked list.
|
|
IP Logged |
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: flatten binary search tree into doubly linked
« Reply #1 on: Dec 3rd, 2008, 2:04am » |
Quote Modify
|
It was asked before here, among other places.
|
|
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
|