all codes relate to algorithm study