Guest User

Untitled

a guest
Nov 3rd, 2018
456
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. Example 6: What is the value of k after the following pseudocode has been executed?
  2.  
  3. k := 0
  4. for i_1 := 1 to n
  5. for i_2 := to i_1
  6. .
  7. .
  8. .
  9. for i_m := 1 to i_(m-1)
  10. k := k + 1
  11.  
  12. 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