Samsung Electronics interview question

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