difference between an one pass and a two pass algorithm

I know one pass is reading the input data once and a two pass algorithm is reading it twice.
Can anyone clearly explain what the difference is one more time with a short example of code (both one pass and two pass) that shows the difference between those two and explain why briefly. Sometimes I feel like I understand the concept a bit vaguely.

Thank you.

Comments (3)