Samsung Electronics Interview Question

Find kth node in tree. Print prime numbers in a range.