Juniper Networks Interview Question
59 Interview Reviews |
Back to all Juniper Networks Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Member of Technical Staff IV at Juniper Networks:
Given a binary tree, how would you write program for getting mirror image of tree in O(n) time? Is it possible ? Assume you have no constraints on space.
| Tags: | data structures, algorithm, c, linux, tcp/ip See more , See less 8 |
See more for this Juniper Networks Member of Technical Staff IV Interview
Helpful Question?
Yes |
No
Inappropriate?
Answers & Comments (2)
mirror( root, img_root)
//img_node is passed by reference
mirror (node, img_node ):
if (node == NULL)
return
img_node.left = node.right
img_node.right = mode.left
mirror (node.right, img_node.left)
mirror (node.left, img_node.right)
Helpful Answer?
Yes |
No
Inappropriate?
To comment on this
question,
Sign In with Facebook or
Sign Up
1 of 2 people found this helpful
by Anonymous:
Mirror(Right)
Mirror(Left)
changeNodes(t)