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
Computer Science,
5 months ago
Math,
5 months ago
English,
5 months ago
Computer Science,
11 months ago
Computer Science,
11 months ago