wu :: forums
« wu :: forums - flatten binary search tree into doubly linked list »

Welcome, Guest. Please Login or Register.
Nov 23rd, 2024, 9:50pm

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   microsoft
(Moderators: ThudnBlunder, towr, william wu, Grimbal, Eigenray, Icarus, SMQ)
   flatten binary search tree into doubly linked list
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   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 Quote Modify 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: male
Posts: 13730
Re: flatten binary search tree into doubly linked  
« Reply #1 on: Dec 3rd, 2008, 2:04am »
Quote Quote Modify Modify

It was asked before here, among other places.
IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board