Decision Trees are a type of machine learning algorithm that uses a tree structure to divide data based on logical…