Basic data structure and algorithm implementation on C