Path with a given sum in a tree. complexity nlogn
Print diameter of a tree.
Needle in a haystack. KMP.
linear dp.
Generic string split C++ for topcoder.
general template.