algorithm bases