top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

Invert a binary tree which consists of 0 or 1 in the way, where each node value is a LOGICAL AND between its children?

+2 votes
71 views

You have a binary tree which consists of 0 or 1 in the way, that each node value is a LOGICAL AND between its children:

      0
   /    \
  0      1
 / \    / \
0   1  1   1

You need to write a code, which will invert given LEAF and put tree in a correct state.

Note: Received by some user over whatsapp, sharing in exact form?

posted May 24, 2017 by Salil Agrawal

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...