Booking.com Interview Question for SDE-2s
- 0of 0 votes
public class Node- sg August 18, 2015 in United States
public Node Children;
public Node Right;
Each node represents an element of a tree and specifies a list of immediate children.
The 'Children' property lists all children (in order) but the 'Right' property is set to null.
Suppose you are given the root of a fully populated tree (i.e. a Node called RootNode). Write code to set the 'Right' property so that each node is linked to its right sibling.
| Report Duplicate | Flag | PURGE
Open Chat in New Window