Converting Binary Search Tree into Decreasing Ordered Linked List Given a BST with n nodes, the algorithm should create a linked list that contains a decreasing order sorted array. The algorithm should have a worst case time complexity O(n). The signature of the function should be toList(T, L), where T is the root of the tree and L is a linked list.
The only operation that allowed to use in the linked list is InsertFront.
My attempt:
toList(T , L){
   if (T == null) return
   toList(T.right , L)
   InsertFront(T)
   toList(T.left , L)
}

What do you think about that?
Any suggestions will be great!
Thanks a lot!
The idea seems alright, just a tiny bit of comments:

InsertFront(T) should instead be InsertFront(T.root) (or you will get a linked list of trees).
As is, your function takes two arguments: a tree T and a linked list L, and add the in-order of T in front of L, and returns nothing. If you want a function that returns the in-order, you could add:

inOrder(T){
   L &lt;- empty linked list
   toList(T, L)
   return L
}