Computer Science, asked by amitamit5193, 3 months ago

write an algoritm for last remaning element after removing odd ones out

Answers

Answered by sanjeevikesavarao6
0

Answer:

Given a positive integer N, the task is to print the last remaining element from a sequence [1, N] after repeatedly performing the following operations in the given order alternately:

Remove all the odd-indexed elements from the sequence.

Remove all the even-indexed elements from the sequence.

Similar questions