Monthly Archives: December 2011
Given a text file and a word, find the positions that the word occurs in the file. We’ll be asked to find the positions of many words in the same file.
Given an integer array, one element occurs odd number of times and all others have even occurrences. Find the element with odd occurrences.
This is very similar to the previous post level order print. We again print the tree in level order, but now starting from bottom level to the root. Using the same tree as before: The output should be: 4 5 … Continue reading
Given a binary tree of integers, print it in level order. The output will contain space between the numbers in the same level, and new line between different levels. For example, if the tree is: The output should be: 1 … Continue reading
Given a number, find the next smallest palindrome larger than the number. For example if the number is 125, next smallest palindrome is 131.