Google interview question

Problems related to Arrays and Trees.