Decidable vs. Undecidable Problems in Algorithms