Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Example 6: What is the value of k after the following pseudocode has been executed?
- k := 0
- for i_1 := 1 to n
- for i_2 := to i_1
- .
- .
- .
- for i_m := 1 to i_(m-1)
- k := k + 1
- Note that the initial value of k is 0 and that 1 is added to k each time the nested loop is traversed with a sequence of integers i_1, i_2, ..., i_m such that 1 <= i_m <= i_(m-1) <= ... <= i_1 <= n.
Advertisement
Add Comment
Please, Sign In to add comment