1. Data Structures and AlgorithmsExercise 1Write an algorithm to check whether a number is a primenumber or not. Ver. 1.0 Session 2 2. Data Structures and AlgorithmsExercise…