c algorithm utility