update iterative solution
update doc
update C style solution