Pergunta de entrevista da empresa Amazon

Write a code to determing whether a binary tree is symmetric or not (symmetricity is based on data i.e., folding the tree with respect to the root node, all the leaf nodes which overlap should have same data)

Respostas da entrevista

Sigiloso

27 de abr. de 2011

The Strings generated by doing a pre-order and post-order traversals should be reverse of each other

1

Sigiloso

1 de abr. de 2012

a pre-order traversal is enough, is the string is symmetric , then the tree is symmetric

Sigiloso

7 de jan. de 2013

If we do an inorder traversal and the result string is a palindrome, then the tree is symmetric