Matt is right. assuming that you have
Tree
,
LinkedList
and
Queue
structures, you can do something like this:
Tree* tree;
LinkedList* list;
Queue* helper;
void convert() {
Tree* t;
helper->enqueue(tree);
while(helper->count>0) {
t=helper->dequeue();
list->add(t->node);
if(t->left!=NULL)
helper->enqueue(t->left);
if(t->right!=NULL)
helper->enqueue(t->right);
}
}