I have finished red ebony in c and it is difficult for me to print it in level order. I have a print-inorder, but I canβt imagine how I should display it as a tree in console printing. Is it possible? Can we implement BFS or DFS here? I found the algorithm in the wiki, but I cannot apply it. If anyone has the code for this in C, can you post it here so I can learn it? from wiki:
levelorder(root) q = empty queue q.enqueue(root) while not q.empty do node := q.dequeue() visit(node) if node.left β null q.enqueue(node.left) if node.right β null q.enqueue(node.right)
source share