1. Dim C(n) As Integer 2. AA(C, 1, n) 3. For j As Integer = 1 To n 4. For i As Integer = j To j + 5 5. print C(i) + i 6. Next 7. Next Sub AA(C As Integer(), m As Integer, n As Integer) Dim p As Integer = (n – m + 1) / 3 If p > 1 Then For i As Integer = 1 To 4 AA(C, m , m + p) Next For i As Integer = m To n C(i) = C(i) + 1 Next End If End Sub

I need to find the complexity of lines 1-7. But first I have to find out how many times each line will be executed. What I think:

1. Dim C(n) As Integer // 1 2. AA(C, 1, n) // 1 3. For j As Integer = 1 To n // n 4. For i As Integer = j To j + 5 // n-1 5. print C(i) + i // n-2 6. Next 7. Next Sub AA(C As Integer(), m As Integer, n As Integer) Dim p As Integer = (n – m + 1) / 3 // 1 If p > 1 Then // ? For i As Integer = 1 To 4 // n AA(C, m , m + p) // n-1 Next For i As Integer = m To n // n C(i) = C(i) + 1 // n-1 Next End If End Sub

How to determine how many times that if statement will be executed if I don't know what is the value of n?