Compute the Time complexity of this algorithm IN ITSWORST CASE:
Show your solution please! (again Worst Case timecomplexity)
**Same code here if you need to copy it**
import java.util.*;import java.util.Collections;import java.util.ArrayList;public class Degree { public int maxDegree(Node r) { ArrayList<Integer> chills = new ArrayList<Integer>(children.length()); for(int i=0;i<Node[].length();i++) { leaf = isLeaf(Children[i]); if(leaf == True){ return 0; } else{ numchil = numChildren(children[i]); chills.add(numchil); } Collections.sort(chills); return chills.get(chills.size()-1);}} }