[59.] to prove safety Offer zigzag print order to achieve binary tree python

Title Description
Please implement a function according to a binary tree zigzag print, i.e., the first row from left to right order of printing, the print order of the second layer is from right to left, the third row from left to right order of printing, other line and so on.

# -*- coding:utf-8 -*-
# class TreeNode:
#     def __init__(self, x):
#         self.val = x
#         self.left = None
#         self.right = None
class Solution:
    def Print(self, pRoot):
        # write code here
Published 116 original articles · won praise 6 · views 6087

Guess you like

Origin blog.csdn.net/weixin_42247922/article/details/104078141