Microsoft Interview Question
- 2of 2 votes
A quadra tree is a tree where each node has atmost 4 child nodes(similar to a binary tree which has atmost 2 child nodes).- gdg June 28, 2014 in India
A monitor screen (black and white) is represented by a qudra tree in the following way:
case 1: If the entire screen is white then the value in the root node is white.
similarly if the entire screen is black then the root stores black.
case 2: If the screen is neither completely black nor white then the screen is divided into 4 quadrants and the node has 4 child nodes each representing one of the quadrants.( the screen is recursively divided into subscreens).
Now given two screens represented by two quadra trees, return a quadra tree which represents the overlapping of the two screens.( assume when white and white overlaps results in white,black and white overlap results in black , black and black overlap results in black).
algo and code both have to be given.
| Report Duplicate | Flag | PURGE
Open Chat in New Window