Introduction to Two-pass Algorithms