data structure and algorithm implemented by code in c language