Describe how to skip part or a loop using break and continue statement.
Answers
Answered by
3
Answer:
The major difference between break and continue statements in C language is that a break causes the innermost enclosing loop or switch to be exited immediately. ... The continue statement is used when we want to skip one or more statements in loop's body and to transfer the control to the next iteration.
....
Answered by
1
Answer:
Here is a sketch of an algorithm:
For each input number, determine to which interval it belongs, and update corresponding sum: S[int_log(x)] += x.
Compute prefix sum for array S: foreach i: C[i] = C[i-1] + S[i].
Filter array C to keep only entries with values lower than next power of 2
Similar questions
Math,
6 months ago
History,
6 months ago
English,
6 months ago
Computer Science,
1 year ago
Computer Science,
1 year ago