Resources for Time complexity
Anonymous User
130

What is the best place OR How to learn time complexity by examples like below code.
I understand simple loops but feel difficult in little difficult code.

	public int dfs(string w, int depth, HashSet<string> set){
        int max = depth;
        for(int j=0;j<w.Length;j++){
            string b = w.Substring(0,j) + w.Substring(j+1);
            if(set.Contains(b)){
                set.Remove(b);
                max = Math.Max(max, dfs(b, depth+1, set));
            }
        }
        
        return max;
    }
Comments (0)